DayZ
1.24
Loading...
Searching...
No Matches
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
}
ERPCs
ERPCs
Definition
ERPCs.c:2
ComponentBodyStaging
Definition
BodyStaging.c:10
ComponentBodyStaging::ComponentBodyStaging
void ComponentBodyStaging()
Definition
BodyStaging.c:13
ComponentBodyStaging::IsSkinned
bool IsSkinned()
Definition
BodyStaging.c:44
ComponentBodyStaging::~ComponentBodyStaging
void ~ComponentBodyStaging()
Definition
BodyStaging.c:18
ComponentBodyStaging::SetAsSkinned
void SetAsSkinned()
Definition
BodyStaging.c:23
ComponentBodyStaging::SetAsSkinnedClient
void SetAsSkinnedClient()
Definition
BodyStaging.c:49
ComponentBodyStaging::m_IsSkinned
bool m_IsSkinned
Definition
BodyStaging.c:11
ComponentBodyStaging::SynchSkinnedState
void SynchSkinnedState()
Definition
BodyStaging.c:59
Component
Definition
Component.c:16
Component::m_ThisEntityAI
EntityAI m_ThisEntityAI
Definition
Component.c:24
Param3
Definition
EntityAI.c:95
GetGame
proto native CGame GetGame()
scripts
3_Game
tools
Component
BodyStaging.c
Generated by
1.10.0