4645 {
4647 return;
4648
4650 return;
4651
4652 GameInventory inventory = GetInventory();
4654 return;
4655
4656 if (GetThrowing().IsThrowingModeEnabled() || GetThrowing().IsThrowingAnimationPlaying())
4657 return;
4658
4660 return;
4661
4663 return;
4664
4666 return;
4667
4669 return;
4670
4671 if (!ScriptInputUserData.CanStoreInputUserData())
4672 return;
4673
4674
4675
4676
4677
4679
4680 if (!quickBarEntity)
4681 return;
4682
4683 Magazine mag;
4684 Weapon_Base wpn;
4685
4686 if (Class.CastTo(mag, quickBarEntity) && Class.CastTo(wpn, mag.GetHierarchyParent()))
4687 return;
4688
4689 EntityAI inHandEntity = GetEntityInHands();
4690
4691 if (!GetDayZPlayerInventory().
IsIdle())
4692 return;
4693
4694 InventoryLocation handInventoryLocation = new InventoryLocation;
4695 handInventoryLocation.
SetHands(
this,quickBarEntity);
4697 return;
4698
4699 if (inHandEntity == quickBarEntity)
4700 {
4701 if (GetHumanInventory().CanRemoveEntityInHands())
4702 {
4703 if (LogManager.IsSyncLogEnable())
syncDebugPrint(
"[QB] Stash - PredictiveMoveItemFromHandsToInventory HND=" +
Object.GetDebugName(inHandEntity));
4704 PredictiveMoveItemFromHandsToInventory();
4705 }
4706 }
4707 else
4708 {
4709 InventoryLocation invLocQBItem = new InventoryLocation;
4710 quickBarEntity.GetInventory().GetCurrentInventoryLocation(invLocQBItem);
4712 return;
4713
4714 if (inHandEntity)
4715 {
4716 InventoryLocation inHandEntityFSwapDst = new InventoryLocation;
4717
4718 int index = GetHumanInventory().FindUserReservedLocationIndex(inHandEntity);
4719 if (index >= 0)
4720 GetHumanInventory().GetUserReservedLocation(index, inHandEntityFSwapDst);
4721
4722
4723 if (index < 0 && GameInventory.CanSwapEntitiesEx(quickBarEntity, inHandEntity))
4724 {
4725 if (LogManager.IsSyncLogEnable())
syncDebugPrint(
"[QB] PredictiveSwapEntities QB=" +
Object.GetDebugName(quickBarEntity) +
" HND=" +
Object.GetDebugName(inHandEntity));
4727 }
4728 else if (GameInventory.CanForceSwapEntitiesEx(quickBarEntity, handInventoryLocation, inHandEntity, inHandEntityFSwapDst))
4729 {
4730 if (LogManager.IsSyncLogEnable())
syncDebugPrint(
"[QB] Swap - PredictiveForceSwapEntities HND=" +
Object.GetDebugName(inHandEntity) +
" QB=" +
Object.GetDebugName(quickBarEntity) +
" fswap_dst=" + InventoryLocation.DumpToStringNullSafe(inHandEntityFSwapDst));
4732 }
4733 }
4734 else
4735 {
4737 return;
4738
4740 {
4741 if (LogManager.IsSyncLogEnable())
syncDebugPrint(
"[QB] Stash - PredictiveTakeEntityToHands QB=" +
Object.GetDebugName(quickBarEntity));
4743 }
4744 }
4745 }
4746 }
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, ....