Dayz Explorer 1.28.160049
Loading...
Searching...
No Matches
bodystaging.c
Go to the documentation of this file.
1//-----------------------------
2// BODY STAGING
3//-----------------------------
4/*
5Every dead body will have this component which will control its various states.
6Read "Dead bodies staging" design on Confluence.
7*/
8
10{
11 bool m_IsSkinned;
12
14 {
15 m_IsSkinned = false;
16 }
17
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
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}
EntityAI m_ThisEntityAI
Definition component.c:24
ERPCs
Definition erpcs.c:2
proto native CGame GetGame()