4500 {
4502 return;
4503
4505 return;
4506
4508 return;
4509
4510 if (GetThrowing().IsThrowingModeEnabled() || GetThrowing().IsThrowingAnimationPlaying())
4511 return;
4512
4514 return;
4515
4517 return;
4518
4520 return;
4521
4523 return;
4524
4525 if (!ScriptInputUserData.CanStoreInputUserData())
4526 return;
4527
4528
4529
4530
4531
4533
4534 if (!quickBarEntity)
4535 return;
4536
4537 Magazine mag;
4538 Weapon_Base wpn;
4539
4540 if (Class.CastTo(mag, quickBarEntity) && Class.CastTo(wpn, mag.GetHierarchyParent()))
4541 return;
4542
4543 EntityAI inHandEntity = GetHumanInventory().GetEntityInHands();
4544
4545 if (!GetDayZPlayerInventory().
IsIdle())
4546 return;
4547
4548 InventoryLocation handInventoryLocation = new InventoryLocation;
4549 handInventoryLocation.
SetHands(
this,quickBarEntity);
4550 if (this.GetInventory().HasInventoryReservation(quickBarEntity, handInventoryLocation))
4551 return;
4552
4553 if (inHandEntity == quickBarEntity)
4554 {
4555 if (GetHumanInventory().CanRemoveEntityInHands())
4556 {
4557 if (LogManager.IsSyncLogEnable())
syncDebugPrint(
"[QB] Stash - PredictiveMoveItemFromHandsToInventory HND=" +
Object.GetDebugName(inHandEntity));
4558 PredictiveMoveItemFromHandsToInventory();
4559 }
4560 }
4561 else
4562 {
4563 InventoryLocation invLocQBItem = new InventoryLocation;
4564 quickBarEntity.GetInventory().GetCurrentInventoryLocation(invLocQBItem);
4565 if (GetInventory().HasInventoryReservation(quickBarEntity,invLocQBItem))
4566 return;
4567
4568 if (inHandEntity)
4569 {
4570 InventoryLocation Reserved_Item_il = new InventoryLocation;
4571
4572 InventoryLocation inHandEntityFSwapDst = new InventoryLocation;
4573 inHandEntity.GetInventory().GetCurrentInventoryLocation(inHandEntityFSwapDst);
4574
4575 int index = GetHumanInventory().FindUserReservedLocationIndex(inHandEntity);
4576 if (index >= 0)
4577 GetHumanInventory().GetUserReservedLocation(index, Reserved_Item_il);
4578
4579 if (Reserved_Item_il)
4581
4582 if (index < 0 && GameInventory.CanSwapEntitiesEx(quickBarEntity, inHandEntity))
4583 {
4584 if (LogManager.IsSyncLogEnable())
syncDebugPrint(
"[QB] PredictiveSwapEntities QB=" +
Object.GetDebugName(quickBarEntity) +
" HND=" +
Object.GetDebugName(inHandEntity));
4586 }
4587 else if (GameInventory.CanForceSwapEntitiesEx(quickBarEntity, handInventoryLocation, inHandEntity, inHandEntityFSwapDst))
4588 {
4589 if (LogManager.IsSyncLogEnable())
syncDebugPrint(
"[QB] Swap - PredictiveForceSwapEntities HND=" +
Object.GetDebugName(inHandEntity) +
" QB=" +
Object.GetDebugName(quickBarEntity) +
" fswap_dst=" + InventoryLocation.DumpToStringNullSafe(inHandEntityFSwapDst));
4591 }
4592 }
4593 else
4594 {
4595 if (GetInventory().HasInventoryReservation(quickBarEntity,handInventoryLocation))
4596 return;
4597
4598 if (GetInventory().CanAddEntityIntoHands(quickBarEntity))
4599 {
4600 if (LogManager.IsSyncLogEnable())
syncDebugPrint(
"[QB] Stash - PredictiveTakeEntityToHands QB=" +
Object.GetDebugName(quickBarEntity));
4602 }
4603 }
4604 }
4605 }
void syncDebugPrint(string s)
proto native void SetHands(notnull EntityAI parent, EntityAI e)
sets current inventory location type to Hands
proto native InventoryLocation CopyLocationFrom(notnull InventoryLocation rhs, bool copyFlip)
copies location to another location without m_item member
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, ....