4939 {
4941 return;
4942
4944 return;
4945
4946 GameInventory inventory = GetInventory();
4948 return;
4949
4950 if (GetThrowing().IsThrowingModeEnabled() || GetThrowing().IsThrowingAnimationPlaying())
4951 return;
4952
4954 return;
4955
4957 return;
4958
4960 return;
4961
4963 return;
4964
4965 if (!ScriptInputUserData.CanStoreInputUserData())
4966 return;
4967
4968
4969
4970
4971
4973
4974 if (!quickBarEntity)
4975 return;
4976
4977 Magazine mag;
4978 Weapon_Base wpn;
4979
4980 if (Class.CastTo(mag, quickBarEntity) && Class.CastTo(wpn, mag.GetHierarchyParent()))
4981 return;
4982
4983 EntityAI inHandEntity = GetEntityInHands();
4984
4985 if (!GetDayZPlayerInventory().
IsIdle())
4986 return;
4987
4988 InventoryLocation handInventoryLocation = new InventoryLocation;
4989 handInventoryLocation.
SetHands(
this,quickBarEntity);
4991 return;
4992
4993 if (inHandEntity == quickBarEntity)
4994 {
4995 if (GetHumanInventory().CanRemoveEntityInHands())
4996 {
4997 if (LogManager.IsSyncLogEnable())
syncDebugPrint(
"[QB] Stash - PredictiveMoveItemFromHandsToInventory HND=" +
Object.GetDebugName(inHandEntity));
4998 PredictiveMoveItemFromHandsToInventory();
4999 }
5000 }
5001 else
5002 {
5003 InventoryLocation invLocQBItem = new InventoryLocation;
5004 quickBarEntity.GetInventory().GetCurrentInventoryLocation(invLocQBItem);
5006 return;
5007
5008 if (inHandEntity)
5009 {
5010 InventoryLocation inHandEntityFSwapDst = new InventoryLocation;
5011
5012 int index = GetHumanInventory().FindUserReservedLocationIndex(inHandEntity);
5013 if (index >= 0)
5014 GetHumanInventory().GetUserReservedLocation(index, inHandEntityFSwapDst);
5015
5016
5017 if (index < 0 && GameInventory.CanSwapEntitiesEx(quickBarEntity, inHandEntity))
5018 {
5019 if (LogManager.IsSyncLogEnable())
syncDebugPrint(
"[QB] PredictiveSwapEntities QB=" +
Object.GetDebugName(quickBarEntity) +
" HND=" +
Object.GetDebugName(inHandEntity));
5021 }
5022 else if (GameInventory.CanForceSwapEntitiesEx(quickBarEntity, handInventoryLocation, inHandEntity, inHandEntityFSwapDst))
5023 {
5024 if (LogManager.IsSyncLogEnable())
syncDebugPrint(
"[QB] Swap - PredictiveForceSwapEntities HND=" +
Object.GetDebugName(inHandEntity) +
" QB=" +
Object.GetDebugName(quickBarEntity) +
" fswap_dst=" + InventoryLocation.DumpToStringNullSafe(inHandEntityFSwapDst));
5026 }
5027 }
5028 else
5029 {
5031 return;
5032
5034 {
5035 if (LogManager.IsSyncLogEnable())
syncDebugPrint(
"[QB] Stash - PredictiveTakeEntityToHands QB=" +
Object.GetDebugName(quickBarEntity));
5037 }
5038 }
5039 }
5040 }
void syncDebugPrint(string s)
bool IsProcessing()
returns true when FP is heating or cooling
bool CanAddEntityIntoHands(notnull EntityAI item)
Test if entity can be put into hands.
proto native bool IsInventoryLocked()
static proto native bool HasInventoryReservation(EntityAI item, InventoryLocation dst)
Internally: HasInventoryReservationEx(item, dst, FindInventoryReservationMode.LEGACY,...
proto native void SetHands(notnull EntityAI parent, EntityAI e)
sets current inventory location type to Hands
override void PredictiveTakeEntityToHands(EntityAI item)
override bool PredictiveSwapEntities(notnull EntityAI item1, notnull EntityAI item2)
override bool IsRestrained()
override WeaponManager GetWeaponManager()
ActionManagerBase GetActionManager()
bool IsRestrainPrelocked()
EntityAI GetQuickBarEntity(int index)
override bool PredictiveForceSwapEntities(notnull EntityAI item1, notnull EntityAI item2, notnull InventoryLocation item2_dst)
DayZPlayerInstanceType
defined in C++
proto native DayZPlayerInstanceType GetInstanceType()
proto native int GetRunningAction()
returns -1 when no action is running or RELOAD,MECHANISM, ....