Dayz Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Loading...
Searching...
No Matches
remotelyactivateditembehaviour.c
Go to the documentation of this file.
2{
3 protected EntityAI m_Parent;
4 protected EntityAI m_PairDevice;
5 protected int m_PairDeviceNetIdLow;
6 protected int m_PairDeviceNetIdHigh;
7
9 {
10 m_Parent = pParent;
13 }
14
16 {
17 Pair();
18 }
19
20 void Pair()
21 {
22 EntityAI device = EntityAI.Cast(GetGame().GetObjectByNetworkId(GetPairDeviceNetIdLow(), GetPairDeviceNetIdHigh()));
23 if (device)
24 {
25 Pair(device);
26 }
27 }
28
29 void Pair(notnull EntityAI device)
30 {
31 m_PairDevice = device;
32 SetPairDeviceNetIds(device);
33
34 if (!m_Parent.GetPairDevice() || m_Parent.GetPairDevice() != m_PairDevice)
35 {
36 m_PairDevice.PairRemote(m_Parent);
37 }
38
39 m_PairDevice.SetSynchDirty();
40 m_Parent.SetSynchDirty();
41 }
42
43 void Unpair()
44 {
47
48 if (m_PairDevice)
49 {
50 m_PairDevice.SetSynchDirty();
51 m_PairDevice = null;
52 }
53
54 m_Parent.SetSynchDirty();
55 }
56
58 {
59 return m_PairDevice;
60 }
61
62 bool IsPaired()
63 {
64 return m_PairDevice != null;
65 }
66
67 void SetPairDeviceNetIds(notnull EntityAI device)
68 {
69 device.GetNetworkID(m_PairDeviceNetIdLow, m_PairDeviceNetIdHigh);
70 }
71
73 {
75 }
76
81}
class LogManager EntityAI
void RemotelyActivatedItemBehaviour(notnull EntityAI pParent)
void SetPairDeviceNetIds(notnull EntityAI device)
DayZGame GetGame()
Definition gameplay.c:636