Dayz Explorer
1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
bodystaging.c
Go to the documentation of this file.
1
//-----------------------------
2
// BODY STAGING
3
//-----------------------------
4
/*
5
Every dead body will have this component which will control its various states.
6
Read "Dead bodies staging" design on Confluence.
7
*/
8
9
class
ComponentBodyStaging
:
Component
10
{
11
bool
m_IsSkinned;
12
13
void
ComponentBodyStaging
()
14
{
15
m_IsSkinned =
false
;
16
}
17
18
void
~
ComponentBodyStaging
()
19
{
20
21
}
22
23
void
SetAsSkinned()
24
{
25
m_IsSkinned =
true
;
26
27
// Temporal! Body is moved into ground so we can see if it was already skinned or not until necesarry assets are developed.
28
/*
29
if ( !m_ThisEntityAI.IsKindOf("Animal_GallusGallusDomesticus") && !m_ThisEntityAI.IsKindOf("Animal_GallusGallusDomesticusF") )
30
{
31
vector body_new_pos = m_ThisEntityAI.GetPosition() - "0 0.2 0";
32
m_ThisEntityAI.SetPosition(body_new_pos);
33
}
34
else
35
{
36
vector body_new_pos2 = m_ThisEntityAI.GetPosition() - "0 0.08 0";
37
m_ThisEntityAI.SetPosition(body_new_pos2);
38
}
39
*/
40
41
SynchSkinnedState();
42
}
43
44
bool
IsSkinned()
45
{
46
return
m_IsSkinned;
47
}
48
49
void
SetAsSkinnedClient()
50
{
51
m_IsSkinned =
true
;
52
}
53
54
/*====================================
55
SERVER --> CLIENT SYNCHRONIZATION
56
====================================*/
57
58
// Synchronizes properties
59
protected
void
SynchSkinnedState()
60
{
61
if
(
GetGame
().IsServer() )
62
{
63
Param1<bool> p =
new
Param1<bool>( IsSkinned() );
64
GetGame
().RPCSingleParam( m_ThisEntityAI,
ERPCs
.RPC_BS_SKINNED_STATE, p,
true
);
65
}
66
}
67
}
GetGame
proto native CGame GetGame()
Component
Definition:
componententitydebug.c:1
ComponentBodyStaging
Definition:
bodystaging.c:9
ERPCs
ERPCs
Definition:
erpcs.c:1
DAYZ
scripts_v1.24.157551
scripts
game
tools
component
bodystaging.c
Generated by
1.8.17