DayZ 1.24
Loading...
Searching...
No Matches
DayZPlayerCommandDeathCallback Class Reference
Inheritance diagram for DayZPlayerCommandDeathCallback:
[legend]
Collaboration diagram for DayZPlayerCommandDeathCallback:
[legend]

Private Member Functions

override void OnSimulationEnd ()
 
override bool ShouldSimulationBeDisabled ()
 

Private Attributes

PlayerBase m_pPlayer
 

Detailed Description

Definition at line 10 of file DayZPlayerImplement.c.

Member Function Documentation

◆ OnSimulationEnd()

override void DayZPlayerCommandDeathCallback::OnSimulationEnd ( )
inlineprivate

Definition at line 15 of file DayZPlayerImplement.c.

16 {
17 if (LogManager.IsSyncLogEnable()) syncDebugPrint("DZPI::OnSimulationEnd - trying to drop item");
18
19 if (GetGame().IsServer())
20 {
21 EntityAI itemInHands = m_pPlayer.GetHumanInventory().GetEntityInHands();
22 if (itemInHands)
23 {
24 int boneIndex = m_pPlayer.GetBoneIndexByName("RightHand_Dummy");
25
26 vector m4[4];
27 m_pPlayer.GetBoneTransformWS(boneIndex, m4);
28
29 m_pPlayer.GetInventory().DropEntityWithTransform(InventoryMode.SERVER, m_pPlayer, itemInHands, m4);
30
31 if (GetCEApi())
32 {
33 int deadBodyLifetime = GetCEApi().GetCEGlobalInt("CleanupLifetimeDeadPlayer");
34 if (deadBodyLifetime <= 0)
35 deadBodyLifetime = 3600;
36 itemInHands.SetLifetime(deadBodyLifetime);
37 }
38 }
39 }
40 }
void syncDebugPrint(string s)
Definition Debug.c:1
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
Definition Inventory.c:22
proto native CEApi GetCEApi()
Get the CE API.
static bool IsSyncLogEnable()
Definition Debug.c:759
proto native CGame GetGame()

References GetCEApi(), GetGame(), LogManager::IsSyncLogEnable(), m_pPlayer, and syncDebugPrint().

◆ ShouldSimulationBeDisabled()

override bool DayZPlayerCommandDeathCallback::ShouldSimulationBeDisabled ( )
inlineprivate

Definition at line 42 of file DayZPlayerImplement.c.

43 {
44 return m_pPlayer.m_WasInVehicle == false;
45 }

References m_pPlayer.

Member Data Documentation

◆ m_pPlayer

PlayerBase DayZPlayerCommandDeathCallback::m_pPlayer
private

Definition at line 47 of file DayZPlayerImplement.c.

Referenced by OnSimulationEnd(), and ShouldSimulationBeDisabled().


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