DayZ 1.24
Loading...
Searching...
No Matches
HandEventSwap Class Reference

Private Member Functions

void HandEventForceSwap (Man p=null, InventoryLocation src=null, InventoryLocation src2=null, InventoryLocation dst=null, InventoryLocation dst2=null)
 
override bool CheckRequest ()
 
override bool CanPerformEvent ()
 

Detailed Description

Definition at line 621 of file Hand_Events.c.

Member Function Documentation

◆ CanPerformEvent()

override bool HandEventSwap::CanPerformEvent ( )
inlineprivate

Definition at line 643 of file Hand_Events.c.

644 {
645 bool test2 = GameInventory.CanForceSwapEntitiesEx(m_Src.GetItem(), m_Dst, m_Src2.GetItem(), m_Dst2); // null here means 'do not search for dst2' (already have valid one from constructor)
646#ifdef DEVELOPER
648 {
649 if (!test2)
650 Debug.InventoryHFSMLog("CanForceSwapEntitiesEx failed", typename.EnumToString(HandEventID, GetEventID()), "n/a", "CanPerformEvent", m_Player.ToString());
651 }
652#endif
653 return test2;
654 }
DayZPlayer m_Player
Definition Hand_Events.c:42
ref InventoryLocation m_Src
Definition Hand_Events.c:43
HandEventID GetEventID()
Definition Hand_Events.c:53
HandEventID
events
Definition Hand_Events.c:7
Definition Debug.c:14
static void InventoryHFSMLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Definition Debug.c:183
script counterpart to engine's class Inventory
Definition Inventory.c:79
static bool CanForceSwapEntitiesEx(notnull EntityAI item1, InventoryLocation item1_dst, notnull EntityAI item2, out InventoryLocation item2_dst)
Definition Inventory.c:645
static bool IsInventoryHFSMLogEnable()
Definition Debug.c:749

References GameInventory::CanForceSwapEntitiesEx(), GetEventID(), Debug::InventoryHFSMLog(), LogManager::IsInventoryHFSMLogEnable(), m_Player, and m_Src.

◆ CheckRequest()

override bool HandEventSwap::CheckRequest ( )
inlineprivate

Definition at line 625 of file Hand_Events.c.

626 {
627 bool test1 = false;
628 EntityAI inHands = m_Player.GetHumanInventory().GetEntityInHands();
629 if (GetSrcEntity() && inHands && m_Dst && m_Dst.IsValid())
630 {
632#ifdef DEVELOPER
634 {
635 if (!test1)
636 Debug.InventoryHFSMLog("CheckSwapItemsRequest failed", typename.EnumToString(HandEventID, GetEventID()), "n/a", "CheckRequest", m_Player.ToString());
637 }
638#endif
639 }
640 return test1;
641 }
EntityAI GetSrcEntity()
Definition Hand_Events.c:81
const float c_MaxItemDistanceRadius
anti-cheats
Definition Inventory.c:788
static proto native bool CheckSwapItemsRequest(notnull Man requestingPlayer, notnull InventoryLocation src1, notnull InventoryLocation src2, notnull InventoryLocation dst1, notnull InventoryLocation dst2, float radius)

References GameInventory::c_MaxItemDistanceRadius, GameInventory::CheckSwapItemsRequest(), GetEventID(), GetSrcEntity(), Debug::InventoryHFSMLog(), LogManager::IsInventoryHFSMLogEnable(), m_Player, and m_Src.

◆ HandEventForceSwap()

void HandEventSwap::HandEventForceSwap ( Man p = null,
InventoryLocation src = null,
InventoryLocation src2 = null,
InventoryLocation dst = null,
InventoryLocation dst2 = null )
inlineprivate

Definition at line 623 of file Hand_Events.c.

623{ m_EventID = HandEventID.FORCESWAP; }
m_EventID

References m_EventID.


The documentation for this class was generated from the following file: