DayZ 1.28
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ OnFinishProgressServer()

override void ActionCreateGreenhouseGardenPlot::OnFinishProgressServer ( ActionData action_data)
inlineprivate

См. определение в файле ActionCreateGreenhouseGardenPlot.c строка 76

77 {
78 PlaceObjectActionData poActionData;
79 poActionData = PlaceObjectActionData.Cast(action_data);
80 EntityAI entity_for_placing = action_data.m_MainItem;
81 Object targetObject = action_data.m_Target.GetObject();
82
83 vector position = targetObject.GetPosition();
84
85 //Depending on where we dig the required height offset is not the same
86 Land_Misc_Greenhouse greenHouse = Land_Misc_Greenhouse.Cast( targetObject );
87 Land_Misc_Polytunnel polytunnel = Land_Misc_Polytunnel.Cast( targetObject) ;
88
89 if ( polytunnel )
90 position[1] = position[1] - 1.15; //Lower Y position by roughly 1 meter to compensate for spawning location offset
91 else
92 position[1] = position[1] - 1.05;
93
94 vector orientation = targetObject.GetOrientation();
95
97 if (GetGame().IsMultiplayer())
98 {
99 tunnel = Land_Misc_Polytunnel.Cast(action_data.m_Target.GetObject());
100 if (tunnel)
101 {
102 m_GardenPlot = GardenPlot.Cast(GetGame().CreateObjectEx("GardenPlotPolytunnel", position, ECE_KEEPHEIGHT));
103 }
104 else
105 {
106 m_GardenPlot = GardenPlot.Cast(GetGame().CreateObjectEx("GardenPlotGreenhouse", position, ECE_KEEPHEIGHT));
107 }
108
109 m_GardenPlot.SetOrientation(orientation);
110 m_GardenPlot.OnPlacementComplete(action_data.m_Player);
111 }
112
113 //local singleplayer
114 if (!GetGame().IsMultiplayer())
115 {
116 tunnel = Land_Misc_Polytunnel.Cast(action_data.m_Target.GetObject());
117 if (tunnel)
118 {
119 m_GardenPlot = GardenPlot.Cast(GetGame().CreateObjectEx("GardenPlotPolytunnel", position, ECE_KEEPHEIGHT));
120 }
121 else
122 {
123 m_GardenPlot = GardenPlot.Cast(GetGame().CreateObjectEx("GardenPlotGreenhouse", position, ECE_KEEPHEIGHT));
124 }
125
126 m_GardenPlot.SetOrientation(orientation);
127 m_GardenPlot.OnPlacementComplete(action_data.m_Player);
128 }
129 }
class LogManager EntityAI
const int ECE_KEEPHEIGHT
Определения CentralEconomy.c:27
class Land_Misc_Greenhouse extends BuildingSuper Land_Misc_Polytunnel()
Определения Land_Misc_Greenhouse.c:11
void Land_Misc_Greenhouse()
Определения Land_Misc_Greenhouse.c:12
class LOD Object
proto native CGame GetGame()

Перекрестные ссылки ActionData, ECE_KEEPHEIGHT, GetGame(), Land_Misc_Greenhouse(), Land_Misc_Polytunnel() и m_GardenPlot.