33 if (!
GetGame().IsDedicatedServer())
35 if (player.IsPlacingLocal())
37 if (!player.GetHologramLocal().IsColliding())
39 if (item.CanBePlaced(player, player.GetHologramLocal().GetProjectionEntity().GetPosition()))
54 if (
GetGame().IsDedicatedServer())
56 if (action_data.m_Player.IsPlacingServer())
59 action_data.m_Player.GetHologramServer().EvaluateCollision(action_data.m_MainItem);
61 if (!action_data.m_Player.GetHologramServer().IsColliding())
63 if (action_data.m_MainItem.CanBePlaced(action_data.m_Player, action_data.m_Player.GetHologramServer().GetProjectionEntity().GetPosition()))
75 if (super.SetupAction(player, target, item, action_data, extra_data))
79 poActionData.m_AlreadyPlaced =
false;
80 if (!
GetGame().IsDedicatedServer())
82 player.GetHologramLocal().SetUpdatePosition(
false);
84 Hologram hologram = player.GetHologramLocal();
87 poActionData.m_Position = player.GetHologramLocal().GetProjectionPosition();
88 poActionData.m_Orientation = player.GetHologramLocal().GetProjectionOrientation();
90 poActionData.m_Player.SetLocalProjectionPosition(poActionData.m_Position);
91 poActionData.m_Player.SetLocalProjectionOrientation(poActionData.m_Orientation);
99 if (!action_data.m_MainItem)
115 action_data.m_Player.PlacingCompleteLocal();
128 EntityAI entity_for_placing = action_data.m_MainItem;
129 poActionData.m_Player.SetLocalProjectionPosition(poActionData.m_Position);
130 poActionData.m_Player.SetLocalProjectionOrientation(poActionData.m_Orientation);
132 if (action_data.m_MainItem)
134 poActionData.m_Player.PlacingStartServer(action_data.m_MainItem);
136 GetGame().AddActionJuncture(action_data.m_Player, entity_for_placing, 10000);
137 action_data.m_MainItem.SetIsBeingPlaced(
true);
143 action_data.m_Player.PlacingStartServer(action_data.m_MainItem);
144 action_data.m_MainItem.SetIsBeingPlaced(
true);
154 EntityAI entity_for_placing = action_data.m_MainItem;
155 vector position = action_data.m_Player.GetLocalProjectionPosition();
156 vector orientation = action_data.m_Player.GetLocalProjectionOrientation();
158 poActionData.m_AlreadyPlaced =
true;
160 entity_for_placing.OnPlacementComplete(action_data.m_Player, position, orientation);
165 super.OnEndClient(action_data);
168 if (!poActionData.m_AlreadyPlaced)
170 action_data.m_Player.PlacingCancelLocal();
173 poActionData.m_Player.GetActionManager().RequestEndAction();
174 if (action_data.m_Player.GetHologramLocal())
175 action_data.m_Player.GetHologramLocal().SetUpdatePosition(
true);
178 if (action_data.m_MainItem.GetInventory().GetCurrentInventoryLocation(source) && source.GetType() ==
InventoryLocationType.GROUND)
180 action_data.m_Player.PredictiveTakeEntityToHands(action_data.m_MainItem);
187 super.OnEndServer(action_data);
189 if (!action_data || !action_data.m_MainItem)
193 if (!poActionData.m_AlreadyPlaced)
195 GetGame().ClearJunctureEx(action_data.m_Player, action_data.m_MainItem);
196 action_data.m_MainItem.SetIsBeingPlaced(
false);
200 action_data.m_Player.PlacingCancelServer();
201 action_data.m_MainItem.SoundSynchRemoteReset();
206 action_data.m_Player.PlacingCancelLocal();
207 action_data.m_Player.PlacingCancelServer();
212 action_data.m_MainItem.SetIsDeploySound(
false);
213 action_data.m_MainItem.SetIsPlaceSound(
false);
214 action_data.m_MainItem.SoundSynchRemoteReset();
216 if (action_data.m_MainItem.IsBasebuildingKit())
218 action_data.m_MainItem.Delete();
222 GetGame().ClearJunctureEx(action_data.m_Player, action_data.m_MainItem);
229 if (!
GetGame().IsDedicatedServer())
231 if (action_data.m_Player.GetItemInHands())
232 ActiondeployObjectCB.Cast(action_data.m_Callback).DropDuringPlacing();
240 action_data.m_MainItem.SoundSynchRemote();
245 super.WriteToContext(ctx, action_data);
249 ctx.Write(poActionData.m_Position);
250 ctx.Write(poActionData.m_Orientation);
255 if (!action_recive_data)
258 super.ReadFromContext(ctx, action_recive_data);
261 vector entity_position =
"0 0 0";
262 vector entity_orientation =
"0 0 0";
263 if (!ctx.Read(entity_position))
265 if (!ctx.Read(entity_orientation))
268 action_data_po.m_Position = entity_position;
269 action_data_po.m_Orientation = entity_orientation;
276 super.HandleReciveData(action_recive_data, action_data);
281 action_data_po.m_Position = recive_data_po.m_Position;
282 action_data_po.m_Orientation = recive_data_po.m_Orientation;
287 if (item.IsDeployable())
289 if (item.IsHeavyBehaviour())
293 else if (item.IsOneHandedBehaviour())
297 else if (item.IsTwoHandedBehaviour())
303 Debug.Log(
"Error: check " + item +
" behaviour");
308 if (item.IsHeavyBehaviour())
312 else if (item.IsOneHandedBehaviour())
316 else if (item.IsTwoHandedBehaviour())
322 Debug.Log(
"Error: check " + item +
" behaviour");