24 if( !inventory.AddInventoryReservationEx(
m_dst.GetItem(),
m_dst,
GameInventory.c_InventoryReservationTimeoutShortMS) )
33 inventory.ClearInventoryReservationEx(
m_dst.GetItem(),
m_dst);
122 return m_event.ReserveInventory();
127 m_event.ClearInventoryReservation();
160 if (!
Class.CastTo(player, GetInventoryOwner()))
171 if (!
Class.CastTo(player, GetInventoryOwner()))
182 if (!
Class.CastTo(player, GetInventoryOwner()))
197 CreateStableStates();
199 m_Taking =
new HandAnimatedTakingFromAtt(GetManOwner(),
null);
200 m_MovingTo =
new HandAnimatedMovingToAtt(GetManOwner(),
null);
201 m_Swapping =
new HandAnimatedSwapping(GetManOwner(),
null);
202 m_FSwapping =
new HandAnimatedForceSwapping(GetManOwner(),
null);
203 m_FSwappingInst =
new HandAnimatedForceSwapping_Inst(GetManOwner(),
null);
206 HandEventBase _fin_ =
new HandEventHumanCommandActionFinished;
207 HandEventBase _abt_ =
new HandEventHumanCommandActionAborted;
216 m_FSM.AddTransition(
new HandTransition( m_Empty , __T__,
m_Taking, NULL,
new HandSelectAnimationOfTakeToHandsEvent(GetManOwner())));
217 m_FSM.AddTransition(
new HandTransition(
m_Taking , _fin_, m_Empty,
null,
new HandGuardNot(
new HandGuardHasItemInHands(GetManOwner()))));
219 m_FSM.AddTransition(
new HandTransition(
m_Taking , __Xd_, m_Empty,
new HandActionDestroyed,
new HandGuardHasDestroyedItemInHands(GetManOwner())));
223 m_FSM.AddTransition(
new HandTransition( m_Equipped, __M__,
m_MovingTo, NULL,
new HandSelectAnimationOfMoveFromHandsEvent(GetManOwner())));
224 m_FSM.AddTransition(
new HandTransition(
m_MovingTo, __Xd_, m_Empty,
new HandActionDestroyed,
new HandGuardHasDestroyedItemInHands(GetManOwner())));
225 m_FSM.AddTransition(
new HandTransition(
m_MovingTo, _fin_, m_Equipped,
null,
new HandGuardHasItemInHands(GetManOwner())));
230 m_FSM.AddTransition(
new HandTransition( m_Equipped, __W__,
m_Swapping, NULL,
new HandSelectAnimationOfSwapInHandsEvent(GetManOwner())));
231 m_FSM.AddTransition(
new HandTransition(
m_Swapping, __Xd_, m_Empty,
new HandActionDestroyed,
new HandGuardHasDestroyedItemInHands(GetManOwner())));
232 m_FSM.AddTransition(
new HandTransition(
m_Swapping, _fin_, m_Empty,
null,
new HandGuardNot(
new HandGuardHasItemInHands(GetManOwner()))));
239 m_FSM.AddTransition(
new HandTransition(
m_FSwappingInst, __Xd_, m_Empty,
new HandActionDestroyed,
new HandGuardHasDestroyedItemInHands(GetManOwner())));
243 m_FSM.AddTransition(
new HandTransition(
m_FSwapping, _fin_, m_Equipped,
null,
new HandGuardHasItemInHands(GetManOwner())));
245 m_FSM.AddTransition(
new HandTransition(
m_FSwapping, __Xd_, m_Empty,
new HandActionDestroyed,
new HandGuardHasDestroyedItemInHands(GetManOwner())));
274 Class.CastTo(weapon, GetEntityInHands());
276 if (hcw && weapon && weapon.CanProcessWeaponEvents() && !weapon.IsIdle())
280 wpnDebugPrint(
"[wpnfsm] " +
Object.GetDebugName(weapon) +
" Weapon event: ABORT! notifying running state=" + weapon.GetCurrentState());
283 weapon.ProcessWeaponAbortEvent(
new WeaponEventHumanCommandActionAborted(
GetDayZPlayerOwner()));
304 Error(
"[wpnfsm] " +
Object.GetDebugName(GetInventoryOwner()) +
" warning - pending event already posted, curr_event=" +
m_DeferredWeaponEvent.DumpToString() +
" new_event=" + e.DumpToString());
311 Class.CastTo(weapon, GetEntityInHands());
313 string secondPart =
" - ENTITY IN HANDS IS NOT A WEAPON: " +
Object.GetDebugName(GetEntityInHands());
315 string firstPart =
"[wpnfsm] " +
Object.GetDebugName(GetInventoryOwner()) +
" failed to perform weaponevent " +
m_DeferredWeaponEvent.DumpToString();
318 secondPart =
" on " +
Object.GetDebugName(GetEntityInHands()) +
" which is in state " + weapon.GetCurrentState();
319 secondPart +=
" with physical state: J: " + weapon.IsJammed() +
" | ";
320 for (
int i = 0; i < weapon.GetMuzzleCount(); ++i)
322 secondPart +=
"Chamber_" + i +
": B(" + weapon.IsChamberFull(i) +
") F(" + weapon.IsChamberFiredOut(i) +
") E(" + weapon.IsChamberEmpty(i) +
") | ";
323 secondPart +=
"Magazine_" + i +
": " + weapon.GetMagazine(i);
324 if (i < weapon.GetMuzzleCount() - 1)
329 Error(firstPart + secondPart);
338 Class.CastTo(weapon, GetEntityInHands());
340 if (hcw && weapon && weapon.CanProcessWeaponEvents())
342 weapon.GetCurrentState().OnUpdate(dt);
349 if (!weapon.IsIdle())
353 int weaponEventId = hcw.IsEvent();
354 if (weaponEventId == -1)
368 wpnDebugPrint(
"[wpnfsm] " +
Object.GetDebugName(weapon) +
" HandleWeapons: event arrived " +
typename.EnumToString(
WeaponEvents, weaponEventId) +
"(" + weaponEventId +
") fsm_ev=" + anim_event.ToString());
371 if (anim_event != NULL)
373 weapon.ProcessWeaponEvent(anim_event);
377 if (hcw.IsActionFinished())
379 if (weapon.IsWaitingForActionFinish())
383 wpnDebugPrint(
"[wpnfsm] " +
Object.GetDebugName(weapon) +
" Weapon event: finished! notifying waiting state=" + weapon.GetCurrentState());
386 weapon.ProcessWeaponEvent(
new WeaponEventHumanCommandActionFinished(
GetDayZPlayerOwner()));
392 wpnDebugPrint(
"[wpnfsm] " +
Object.GetDebugName(weapon) +
" Weapon event: ABORT! notifying running state=" + weapon.GetCurrentState());
395 weapon.ProcessWeaponAbortEvent(
new WeaponEventHumanCommandActionAborted(
GetDayZPlayerOwner()));
409 exitIronSights =
true;
433 Class.CastTo(weapon, ih);
437 m_FSM.GetCurrentState().OnUpdate(dt);
446 if ( !m_FSM.GetCurrentState().IsIdle() || !m_FSM.IsRunning())
450 int weaponEventId = hcw.IsEvent();
451 if (weaponEventId == -1)
461 hndDebugPrint(
"[hndfsm] HandleInventory: event arrived " +
typename.EnumToString(
WeaponEvents, weaponEventId) +
"(" + weaponEventId +
") fsm_ev=" + anim_event.ToString());
465 if (anim_event != NULL)
468 ProcessHandEvent(anim_event);
472 if (hcw.IsActionFinished())
474 if (m_FSM.GetCurrentState().IsWaitingForActionFinish())
479 hndDebugPrint(
"[hndfsm] Hand-Weapon event: finished! notifying waiting state=" + m_FSM.GetCurrentState());
483 HandEventBase fin_event =
new HandEventHumanCommandActionFinished(GetManOwner());
485 ProcessHandEvent(fin_event);
492 hndDebugPrint(
"[hndfsm] Hand-Weapon event: ABORT! notifying running state=" + m_FSM.GetCurrentState());
496 HandEventBase abt_event =
new HandEventHumanCommandActionAborted(GetManOwner());
498 ProcessHandAbortEvent(abt_event);
576 if (
GetGame().IsDedicatedServer())
581 int udtIdentifier = -1;
601 src.ReadFromContext(ctx);
602 dst.ReadFromContext(ctx);
614 src.ReadFromContext(ctx);
615 temp.ReadFromContext(ctx);
616 dst.ReadFromContext(ctx);
617 temp.ReadFromContext(ctx);
626 src.ReadFromContext(ctx);
632 if (!ctx.Read(reason))
744 src.ReadFromContext(ctx);
745 dst.ReadFromContext(ctx);
754 if (validation.m_IsRemote && (!src.GetItem() || !dst.GetItem()))
841 LocationSyncMoveEntity(src, dst);
858 DumpInventoryDebug();
887 Error(
"[syncinv] HandleInputData: unexpected return code from AcquireInventoryJunctureFromServer");
907 if (!validation.m_IsRemote && !validation.m_IsJuncture && !
GameInventory.LocationCanMoveEntitySyncCheck(src, dst))
910 DumpInventoryDebug();
929 LocationSyncMoveEntity(src, dst);
940 e.ClearInventoryReservation();
945 e.m_IsRemote = validation.m_IsRemote;
946 e.m_IsJuncture = validation.m_IsJuncture;
948 EntityAI itemSrc = e.GetSrcEntity();
949 EntityAI itemDst = e.GetSecondSrcEntity();
954 Debug.InventoryMoveLog(
"STS = " + e.m_Player.GetSimulationTimeStamp() +
" event= " + e.DumpToString(),
"HAND_EVENT" ,
"n/a",
"ProcessInputData", e.m_Player.ToString() );
958 if (validation.m_IsRemote && !e.GetSrcEntity())
965 Debug.InventoryMoveLog(
"Failed - CheckRequestSrc",
"HAND_EVENT" ,
"n/a",
"ProcessInputData", e.m_Player.ToString() );
969 Error(
"[syncinv] HandleInputData remote input (cmd=HAND_EVENT, event=" + e.DumpToString() +
") dropped, item not in bubble");
983 if (!validation.m_IsRemote && !validation.m_IsJuncture && !e.CheckRequestSrc())
988 Debug.InventoryMoveLog(
"Failed - CheckRequestSrc",
"HAND_EVENT" ,
"n/a",
"ProcessInputData", e.m_Player.ToString() );
992 if (!validation.m_IsRemote)
1004 if (!e.CheckRequestEx(validation))
1009 Debug.InventoryMoveLog(
"Failed - CheckRequest",
"HAND_EVENT" ,
"n/a",
"ProcessInputData", e.m_Player.ToString() );
1030 if (!validation.m_IsRemote && !e.CanPerformEventEx(validation))
1035 Debug.InventoryMoveLog(
"Failed - CanPerformEvent",
"HAND_EVENT" ,
"n/a",
"ProcessInputData", e.m_Player.ToString() );
1046 syncDebugPrint(
"[desync] HandleInputData man=" +
Object.GetDebugName(GetManOwner()) +
" CANNOT do cmd=HAND_EVENT e=" + e.DumpToString());
1066 Debug.InventoryMoveLog(
"Juncture not required",
"HAND_EVENT" ,
"n/a",
"ProcessInputData", e.m_Player.ToString() );
1077 Debug.InventoryMoveLog(
"Juncture sended",
"HAND_EVENT" ,
"n/a",
"ProcessInputData", e.m_Player.ToString() );
1097 Debug.InventoryMoveLog(
"Juncture denied",
"HAND_EVENT" ,
"n/a",
"ProcessInputData", e.m_Player.ToString() );
1106 Error(
"[syncinv] HandleInputData: unexpected return code from AcquireInventoryJunctureFromServer");
1121 Debug.InventoryMoveLog(
"Success - ProcessHandEvent",
"HAND_EVENT" ,
"n/a",
"ProcessInputData", e.m_Player.ToString() );
1126 if (!e.m_Player.GetHumanInventory().ProcessHandEvent(e))
1145 bool skippedSwap =
false;
1147 src1.ReadFromContext(ctx);
1148 src2.ReadFromContext(ctx);
1149 dst1.ReadFromContext(ctx);
1150 dst2.ReadFromContext(ctx);
1151 ctx.Read(skippedSwap);
1160 if (validation.m_IsRemote && (!src1.GetItem() || !src2.GetItem()))
1188 Error(
"[syncinv] HandleInputData remote input (cmd=SWAP) dropped, item not in bubble");
1275 if (!validation.m_IsRemote && !validation.m_IsJuncture && !
GameInventory.CanForceSwapEntitiesEx(src1.GetItem(), dst1, src2.GetItem(), dst2))
1278 DumpInventoryDebug();
1292 AddInventoryReservationEx(dst1.GetItem(), dst1,
GameInventory.c_InventoryReservationTimeoutShortMS);
1293 AddInventoryReservationEx(dst2.GetItem(), dst2,
GameInventory.c_InventoryReservationTimeoutShortMS);
1296 if (!(src1.IsValid() && src2.IsValid() && dst1.IsValid() && dst2.IsValid()))
1345 Error(
"[syncinv] HandleInputData: unexpected return code from TryAcquireTwoInventoryJuncturesFromServer");
return true;
1364 bool isNotSkipped = LocationSwap(src1, src2, dst1, dst2);
1377 if (validation.m_IsJuncture)
1390 src.ReadFromContext(ctx);
1399 if (validation.m_IsRemote && !src.GetItem())
1408 Error(
"[syncinv] HandleInputData remote input (cmd=DESTROY) dropped, item not in bubble");
1449 GetGame().ObjectDelete(src.GetItem());
1461 if (isJuncture && isRemote)
1468 if (!ctx.Read(type))
1474 validation.m_IsJuncture = isJuncture;
1475 validation.m_IsRemote = isRemote;
1483 if (!ValidateUserReservationCancel(serializer, validation))
1518 switch (validation.m_Result)
1521 if (canSendJuncture)
1524 if (!serializer.CanWrite())
1527 writeableSerializer.CopyFrom(serializer);
1528 serializer = writeableSerializer;
1531 serializer.Write(validation.m_Reason);
1537 if (canSendJuncture)
1544 Error(
"InventoryValidationResult.JUNCTURE returned when not possible to send!");
1559 itemIB.SetCanBeMovedOverride(
false);
1566 itemIB.SetCanBeMovedOverride(
true);
1572 Rope rope = Rope.Cast(src.GetItem());
1574 rope.SetTargetLocation(dst);
1602 if (GetManOwner().IsAlive() ==
false)
1603 return super.TakeToDst(mode, src, dst);
1615 if (RedirectToHandEvent(mode, src, dst))
1628 if (
GetDayZPlayerOwner().NeedInventoryJunctureFromServer(src.GetItem(), src.GetParent(), dst.GetParent()))
1677 LocationSyncMoveEntity(src, dst);
1680 if(!super.TakeToDst(mode,src,dst))
1698 if( deferred_take_to_dst )
1707 deferred_take_to_dst.ClearInventoryReservation(
this);
1714 switch (deferred_take_to_dst.m_mode)
1724 if (LocationCanMoveEntity(deferred_take_to_dst.m_src,deferred_take_to_dst.m_dst))
1727 LocationSyncMoveEntity(deferred_take_to_dst.m_src, deferred_take_to_dst.m_dst);
1747 if (LocationCanMoveEntity(deferred_take_to_dst.m_src,deferred_take_to_dst.m_dst))
1750 player.GetHumanInventory().AddInventoryReservationEx(deferred_take_to_dst.m_dst.GetItem(), deferred_take_to_dst.m_dst,
GameInventory.c_InventoryReservationTimeoutShortMS);
1781 Error(
"HandEvent - Invalid mode");
1799 if (
GameInventory.MakeSrcAndDstForSwap(item1, item2, src1, src2, dst1, dst2))
1801 LocationSwap(src1, src2, dst1, dst2);
1806 if(!super.SwapEntities(mode,item1,item2))
1810 if(
GameInventory.MakeSrcAndDstForSwap(item1, item2, src1, src2, dst1, dst2) );
1826 if( deferred_swap_entities )
1828 deferred_swap_entities.ClearInventoryReservation(
this);
1830 if (
GameInventory.MakeSrcAndDstForSwap(deferred_swap_entities.m_item1, deferred_swap_entities.m_item2, src1, src2, dst1, dst2))
1837 switch (deferred_swap_entities.m_mode)
1840 if (CanSwapEntitiesEx(deferred_swap_entities.m_dst1.GetItem(),deferred_swap_entities.m_dst2.GetItem()) )
1842 InventoryInputUserData.SendInputUserDataSwap(src1, src2, deferred_swap_entities.m_dst1, deferred_swap_entities.m_dst2);
1843 LocationSwap(src1, src2, deferred_swap_entities.m_dst1, deferred_swap_entities.m_dst2);
1850 Debug.InventoryMoveLog(
"Can not swap (PREDICTIVE) STS = " +
GetDayZPlayerOwner().GetSimulationTimeStamp() +
" item1 = " + deferred_swap_entities.m_dst1.GetItem() +
" item2 = " + deferred_swap_entities.m_dst2.GetItem() +
" dst=" +
InventoryLocation.DumpToStringNullSafe(deferred_swap_entities.m_dst2),
"n/a" ,
"n/a",
"ForceSwapEntities",
GetDayZPlayerOwner().
ToString() );
1857 if (CanSwapEntitiesEx(deferred_swap_entities.m_dst1.GetItem(),deferred_swap_entities.m_dst2.GetItem()) )
1860 player.GetHumanInventory().AddInventoryReservationEx(deferred_swap_entities.m_dst1.GetItem(), deferred_swap_entities.m_dst1,
GameInventory.c_InventoryReservationTimeoutShortMS);
1861 player.GetHumanInventory().AddInventoryReservationEx(deferred_swap_entities.m_dst2.GetItem(), deferred_swap_entities.m_dst2,
GameInventory.c_InventoryReservationTimeoutShortMS);
1864 InventoryInputUserData.SendInputUserDataSwap(src1, src2, deferred_swap_entities.m_dst1, deferred_swap_entities.m_dst2);
1871 Debug.InventoryMoveLog(
"Can not swap (JUNCTURE) STS = " +
GetDayZPlayerOwner().GetSimulationTimeStamp() +
" item1 = " + deferred_swap_entities.m_dst1.GetItem() +
" item2 = " + deferred_swap_entities.m_dst2.GetItem() +
" dst=" +
InventoryLocation.DumpToStringNullSafe(deferred_swap_entities.m_dst2),
"n/a" ,
"n/a",
"ForceSwapEntities",
GetDayZPlayerOwner().
ToString() );
1881 Error(
"SwapEntities - HandEvent - Invalid mode");
1885 Error(
"SwapEntities - MakeSrcAndDstForSwap - no inv loc");
1901 if (
GameInventory.MakeSrcAndDstForForceSwap(item1, item2, src1, src2, dst1, item2_dst))
1903 LocationSwap(src1, src2, dst1, item2_dst);
1909 if(!super.ForceSwapEntities(mode,item1,item2,item2_dst))
1913 if (
GameInventory.MakeSrcAndDstForForceSwap(item1, item2, src1, src2, dst1, item2_dst))
1931 if (deferred_force_swap_entities)
1933 deferred_force_swap_entities.ClearInventoryReservation(
this);
1936 deferred_force_swap_entities.m_item1.GetInventory().GetCurrentInventoryLocation(src1);
1937 deferred_force_swap_entities.m_item2.GetInventory().GetCurrentInventoryLocation(src2);
1946 switch (deferred_force_swap_entities.m_mode)
1949 if (CanForceSwapEntitiesEx(deferred_force_swap_entities.m_dst1.GetItem(),deferred_force_swap_entities.m_dst1,deferred_force_swap_entities.m_dst2.GetItem(), deferred_force_swap_entities.m_dst2))
1951 InventoryInputUserData.SendInputUserDataSwap(src1, src2, deferred_force_swap_entities.m_dst1, deferred_force_swap_entities.m_dst2);
1952 LocationSwap(src1, src2, deferred_force_swap_entities.m_dst1, deferred_force_swap_entities.m_dst2);
1959 Debug.InventoryMoveLog(
"Can not force swap (PREDICTIVE) STS = " +
GetDayZPlayerOwner().GetSimulationTimeStamp() +
" item1 = " + deferred_force_swap_entities.m_dst1.GetItem() +
" item2 = " + deferred_force_swap_entities.m_dst2.GetItem() +
" dst=" +
InventoryLocation.DumpToStringNullSafe(deferred_force_swap_entities.m_dst2),
"n/a" ,
"n/a",
"ForceSwapEntities",
GetDayZPlayerOwner().
ToString());
1966 if (CanForceSwapEntitiesEx(deferred_force_swap_entities.m_dst1.GetItem(),deferred_force_swap_entities.m_dst1,deferred_force_swap_entities.m_dst2.GetItem(), deferred_force_swap_entities.m_dst2))
1968 player.GetHumanInventory().AddInventoryReservationEx(deferred_force_swap_entities.m_item1, deferred_force_swap_entities.m_dst1,
GameInventory.c_InventoryReservationTimeoutShortMS);
1969 player.GetHumanInventory().AddInventoryReservationEx(deferred_force_swap_entities.m_item2, deferred_force_swap_entities.m_dst2,
GameInventory.c_InventoryReservationTimeoutShortMS);
1971 InventoryInputUserData.SendInputUserDataSwap(src1, src2, deferred_force_swap_entities.m_dst1, deferred_force_swap_entities.m_dst2);
1978 Debug.InventoryMoveLog(
"Can not force swap (JUNCTURE) STS = " +
GetDayZPlayerOwner().GetSimulationTimeStamp() +
" item1 = " + deferred_force_swap_entities.m_dst1.GetItem() +
" item2 = " + deferred_force_swap_entities.m_dst2.GetItem() +
" dst=" +
InventoryLocation.DumpToStringNullSafe(deferred_force_swap_entities.m_dst2),
"n/a" ,
"n/a",
"ForceSwapEntities",
GetDayZPlayerOwner().
ToString());
1988 Error(
"ForceSwapEntities - HandEvent - Invalid mode");
1997 if (e.IsServerSideOnly())
1999 Error(
"[syncinv] " +
Object.GetDebugName(player) +
" SendServerHandEventViaJuncture - called on server side event only, e=" + e.DumpToString());
2002 if (player.IsAlive())
2006 if (src.IsValid() && dst.IsValid())
2008 if (player.NeedInventoryJunctureFromServer(src.GetItem(), src.GetParent(), dst.GetParent()))
2015 if (
GetGame().AddInventoryJunctureEx(player, src.GetItem(), dst,
true,
GameInventory.c_InventoryReservationTimeoutMS))
2051 Error(
"[syncinv] SendServerHandEventViaJuncture - called on dead player, juncture is for living only");
2061 super.NetSyncCurrentStateID(
id);
2082 if (GetEntityInHands())
2092 pb.GetWeaponManager().SetRunning(
true);
2096 fsmDebugSpam(
"[wpnfsm] " +
Object.GetDebugName(wpn) +
" recv event from remote: created event=" + e);
2099 if (e.GetEventID() ==
WeaponEventID.HUMANCOMMAND_ACTION_ABORTED)
2101 wpn.ProcessWeaponAbortEvent(e);
2105 wpn.ProcessWeaponEvent(e);
2107 pb.GetWeaponManager().SetRunning(
false);
2111 Error(
"OnEventForRemoteWeapon - entity in hands, but not weapon. item=" + GetEntityInHands());
2114 Error(
"OnEventForRemoteWeapon - no entity in hands");
2129 hndDebugSpam(
"[hndfsm] recv event from remote: created event=" + e);
2134 if (e.GetEventID() ==
HandEventID.HUMANCOMMAND_ACTION_ABORTED)
2137 m_FSM.ProcessAbortEvent(e, aa);
2141 m_FSM.ProcessEvent(e);
2157 e.WriteToContext(ctx);
2161 hndDebugPrint(
"[hndfsm] send 2 remote: sending e=" + e +
" id=" + e.GetEventID() +
" p=" + p +
" e=" + e.DumpToString());
2164 p.StoreInputForRemotes(ctx);
2170 super.OnHandsExitedStableState(src, dst);
2174 hndDebugPrint(
"[hndfsm] hand fsm exit stable src=" + src.Type().ToString());
2180 super.OnHandsEnteredStableState(src, dst);
2184 hndDebugPrint(
"[hndfsm] hand fsm entered stable dst=" + dst.Type().ToString());
2190 super.OnHandsStateChanged(src, dst);
2194 hndDebugPrint(
"[hndfsm] hand fsm changed state src=" + src.Type().ToString() +
" ---> dst=" + dst.Type().ToString());
2216 EntityAI itemInHands = GetEntityInHands();
2219 handInventoryLocation.SetHands(GetInventoryOwner(), itemInHands);
2222 if (e.CanPerformEventEx(validation))
2244 serializer.Write(validation.m_Reason);
2260 if (deferred_hand_event)
2271 hndDebugPrint(
"[inv] HumanInventory::HandEvent(" +
typename.EnumToString(
InventoryMode, deferred_hand_event.m_mode) +
") ev=" + deferred_hand_event.m_event.DumpToString());
2274 switch (deferred_hand_event.m_mode)
2284 deferred_hand_event.ClearInventoryReservation(
this);
2285 if (deferred_hand_event.m_event.CanPerformEventEx(validation))
2288 ProcessHandEvent(deferred_hand_event.m_event);
2300 deferred_hand_event.ClearInventoryReservation(
this);
2301 if (deferred_hand_event.m_event.CanPerformEventEx(validation))
2303 deferred_hand_event.ReserveInventory(
this);
2307 EntityAI itemSrc = deferred_hand_event.m_event.GetSrcEntity();
2309 if (deferred_hand_event.m_event.GetDst())
2310 itemDst = deferred_hand_event.m_event.GetDst().GetItem();
2326 deferred_hand_event.ClearInventoryReservation(
this);
2327 ProcessHandEvent(deferred_hand_event.m_event);
2344 if (!deferred_hand_event.m_event.IsServerSideOnly())
2357 ProcessHandEvent(deferred_hand_event.m_event);
2362 Error(
"HumanInventory::HandEvent - Invalid mode");
2369 super.HandleInventoryManipulation();
2400 if (player.IsAlive())
2402 if (!player.IsRestrained() && !player.IsUnconscious())
2431 if (player.IsAlive())
2433 if (!player.IsRestrained() && !player.IsUnconscious())
2444 result = CheckMoveToDstRequest( GetManOwner(), src, dst, radius);
2458 player =
PlayerBase.Cast(ent.GetHierarchyRootPlayer());
2463 if (player.IsAlive())
2465 if (!player.IsRestrained() && !player.IsUnconscious())
2474 ent = dst2.GetParent();
2477 player =
PlayerBase.Cast(ent.GetHierarchyRootPlayer());
2482 if (player.IsAlive())
2484 if (!player.IsRestrained() && !player.IsUnconscious())
2496 result = CheckSwapItemsRequest( GetManOwner(), src1, src2, dst1, dst2,
GameInventory.c_MaxItemDistanceRadius);
2515 if (player.IsAlive())
2517 if (!player.IsRestrained() && !player.IsUnconscious())
2528 result = CheckDropRequest( GetManOwner(), src, radius);