Dayz Explorer 1.28.160049
Loading...
Searching...
No Matches
actiontoggletentopen.c
Go to the documentation of this file.
2{
4 {
5 m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_INTERACTONCE;
6 m_Text = "#toggle_opening";
7 }
8
9 override void CreateConditionComponents()
10 {
13 }
14
15 override bool IsUsingProxies()
16 {
17 return true;
18 }
19
20 override bool ActionCondition( PlayerBase player, ActionTarget target, ItemBase item )
21 {
22 Object targetObject = target.GetObject();
23 Object targetParent = target.GetParent();
24
25 if ( player && targetObject && targetParent )
26 {
27 if ( targetParent.IsInherited(TentBase) )
28 {
29 array<string> selections = new array<string>;
30 targetObject.GetActionComponentNameList(target.GetComponentIndex(), selections);
31 TentBase tent = TentBase.Cast( targetParent );
32
33 for (int s = 0; s < selections.Count(); s++)
34 {
35 if ( tent.CanToggleAnimations(selections[s]) )
36 {
37 //Print("nazov selekcie: " + selections[s]);
38 return true;
39 }
40 }
41 }
42 }
43
44 return false;
45 }
46
47 override void OnExecuteServer( ActionData action_data )
48 {
49 Object targetObject = action_data.m_Target.GetObject();
50 Object targetParent = action_data.m_Target.GetParent();
51
52 if ( targetParent && targetParent.IsInherited(TentBase) )
53 {
54 array<string> selections = new array<string>;
55 targetObject.GetActionComponentNameList(action_data.m_Target.GetComponentIndex(), selections);
56
57 TentBase tent = TentBase.Cast( targetParent );
58 for ( int s = 0; s < selections.Count(); s++)
59 {
60 if ( tent.CanToggleAnimations(selections[s]) )
61 {
62 tent.ToggleAnimation( selections[s] );
63 }
64 }
65
66 //regenerate pathgraph
67 tent.SetAffectPathgraph( true, false );
68
69 if ( tent.CanAffectPathgraph() )
70 {
71 //Start update
72 tent.RegenerateNavmesh();
73 }
74 }
75 }
76};
string m_Text
Definition actionbase.c:58
ref CCIBase m_ConditionItem
Definition actionbase.c:64
ref CCTBase m_ConditionTarget
Definition actionbase.c:65
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602