27 bool result =
m_arg0.GuardCondition(e) &&
m_arg1.GuardCondition(e);
32 Debug.
InventoryHFSMLog(
"GuardCondition result: " + result +
" - " +
m_arg0.Type() +
" && " +
m_arg1.Type(),
"HandGuardAnd" ,
"n/a",
"GuardCondition", e.m_Player.ToString() );
42 ref HandGuardBase m_arg0;
48 bool result = !
m_arg0.GuardCondition(e);
53 Debug.
InventoryHFSMLog(
"GuardCondition result: " + result +
" - " +
m_arg0.Type(),
"HandGuardNot" ,
"n/a",
"GuardCondition", e.m_Player.ToString() );
62 ref HandGuardBase m_arg0;
63 ref HandGuardBase m_arg1;
69 bool result =
m_arg0.GuardCondition(e) ||
m_arg1.GuardCondition(e);
74 Debug.
InventoryHFSMLog(
"GuardCondition result: " + result +
" - " +
m_arg0.Type() +
" || " +
m_arg1.Type(),
"HandGuardOr" ,
"n/a",
"GuardCondition", e.m_Player.ToString() );
100 #ifdef ENABLE_LOGGING
126 #ifdef ENABLE_LOGGING
129 Debug.
InventoryHFSMLog(
"GuardCondition result: " + result,
"HandGuardHasWeaponInEvent",
"n/a",
"GuardCondition", e.m_Player.ToString() );
144 if (e.GetSrcEntity() ==
m_Player.GetHumanInventory().GetEntityInHands())
149 #ifdef ENABLE_LOGGING
152 Debug.
InventoryHFSMLog(
"GuardCondition result: " + result +
" - srcItem = " + e.GetSrcEntity() +
" hnd= " +
m_Player.GetHumanInventory().GetEntityInHands(),
"HandGuardIsSameItemInHands" ,
"n/a",
"GuardCondition", e.m_Player.ToString() );
167 if (e.GetSrcEntity())
169 if (e.GetSrcEntity() == hnd)
171 #ifdef ENABLE_LOGGING
174 Debug.
InventoryHFSMLog(
"GuardCondition result: true - has same entity in hands " + hnd,
"HandGuardHasDestroyedItemInHands" ,
"n/a",
"GuardCondition",
m_Player.ToString() );
182 #ifdef ENABLE_LOGGING
185 Debug.
InventoryHFSMLog(
"GuardCondition result: true - hands already empty",
"HandGuardHasDestroyedItemInHands" ,
"n/a",
"GuardCondition",
m_Player.ToString() );
193 #ifdef ENABLE_LOGGING
196 Debug.
InventoryHFSMLog(
"GuardCondition result: true - hands already empty and item destroyed",
"HandGuardHasDestroyedItemInHands" ,
"n/a",
"GuardCondition",
m_Player.ToString() );
201 #ifdef ENABLE_LOGGING
204 Debug.
InventoryHFSMLog(
"GuardCondition result: false - destroyed entity not in hands",
"HandGuardHasDestroyedItemInHands" ,
"n/a",
"GuardCondition",
m_Player.ToString() );
219 if (
m_Player.GetHumanInventory().GetEntityInHands())
224 #ifdef ENABLE_LOGGING
227 Debug.
InventoryHFSMLog(
"GuardCondition result: " + result +
" - " +
m_Player.GetHumanInventory().GetEntityInHands(),
"HandGuardHasItemInHands" ,
"n/a",
"GuardCondition",
m_Player.ToString() );
244 if ( !
GetGame().IsDedicatedServer())
252 #ifdef ENABLE_LOGGING
264 if ( !
GetGame().IsDedicatedServer())
270 #ifdef ENABLE_LOGGING
279 #ifdef ENABLE_LOGGING
282 Debug.
InventoryHFSMLog(
"GuardCondition result: false - e.m_Dst is null",
"HandGuardHasRoomForItem" ,
"n/a",
"GuardCondition",
m_Player.ToString() );
297 HandEventMoveTo es = HandEventMoveTo.Cast(e);
299 bool result = e.m_IsJuncture || e.m_IsRemote;
305 #ifdef ENABLE_LOGGING
325 bool result = e.m_IsJuncture || e.m_IsRemote;
331 #ifdef ENABLE_LOGGING
349 HandEventForceSwap es = HandEventForceSwap.Cast(e);
351 bool result = e.m_IsJuncture || e.m_IsRemote;
356 if (result ==
false && es.m_Dst2)
362 #ifdef ENABLE_LOGGING
380 HandEventForceSwap es = HandEventForceSwap.Cast(e);
394 #ifdef ENABLE_LOGGING
InventoryLocationType
types of Inventory Location
static void InventoryHFSMLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
static proto native bool LocationTestAddEntity(notnull InventoryLocation inv_loc, bool do_resevation_check, bool do_item_check, bool do_lock_check, bool do_occupancy_test, bool do_script_check, bool do_script_load_check)
test if the entity contained in inv_loc.m_item can be added to ground/attachment/cargo/hands/....
const int c_InventoryReservationTimeoutShortMS
static bool CanSwapEntitiesEx(notnull EntityAI item1, notnull EntityAI item2)
static proto native bool LocationCanMoveEntity(notnull InventoryLocation src, notnull InventoryLocation dst)
queries if the entity contained in inv_loc.m_item can be moved to another location This is a shorthan...
static bool CanForceSwapEntitiesEx(notnull EntityAI item1, InventoryLocation item1_dst, notnull EntityAI item2, out InventoryLocation item2_dst)
script counterpart to engine's class Inventory
override InventoryLocation GetDst()
Abstracted event, not to be used, only inherited.
void HandGuardIsSameItemInHands(Man p=null)
void HandGuardInstantForceSwap(Man p=NULL)
void HandGuardCanMove(Man p=null)
void HandGuardHasRoomForItem(Man p=null)
void HandGuardCanSwap(Man p=NULL)
void HandGuardHasDestroyedItemInHands(Man p=null)
void HandGuardNot(HandGuardBase arg0=null)
void HandGuardOr(HandGuardBase arg0=null, HandGuardBase arg1=null)
void HandGuardHasItemInEvent(Man p=null)
void HandGuardCanForceSwap(Man p=NULL)
void HandGuardAnd(HandGuardBase arg0=null, HandGuardBase arg1=null)
bool GuardCondition(HandEventBase e)
void HandGuardHasItemInHands(Man p=null)
override bool GuardCondition(HandEventBase e)
TODO(kumarjac): This guard is unused but it has a fault and doesn't conform with maximimal/minimal ch...
void HandGuardHasWeapoonInEvent(Man p=null)
override bool GuardCondition(HandEventBase e)
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
static string DumpToStringNullSafe(InventoryLocation loc)
proto native int GetType()
returns type of InventoryLocation
proto native EntityAI GetItem()
returns item of current inventory location
static bool IsInventoryHFSMLogEnable()
proto native CGame GetGame()