71 {
72 PlaceObjectActionData poActionData = PlaceObjectActionData.Cast(action_data);
73 if (!poActionData)
74 return;
75
76 if (!poActionData.m_MainItem)
77 return;
78
79 EntityAI entity_for_placing = poActionData.m_MainItem;
80 vector position = vector.Zero;
81 vector orientation = vector.Zero;
82
83
85 {
86 if (poActionData.m_Player.GetHologramServer())
87 {
90
91 poActionData.m_Player.GetHologramServer().EvaluateCollision(poActionData.m_MainItem);
92 if (
GetGame().IsMultiplayer() && poActionData.m_Player.GetHologramServer().IsColliding())
93 return;
94
95 poActionData.m_Player.GetHologramServer().PlaceEntity(entity_for_placing);
96
98 poActionData.m_Player.GetHologramServer().CheckPowerSource();
99
100 #ifdef DEVELOPER
102 {
103 Debug.Log(
string.Format(
"Hologram of %1 found, deployment successful.", poActionData.m_MainItem),
"hologramLogs");
104 Debug.Log(
string.Format(
"Pos Comparison | player: %1 | hologram: %2 | action data: %3", poActionData.m_Player.GetPosition(),poActionData.m_Player.GetLocalProjectionPosition(),position),
"hologramLogs");
105 }
106 #endif
107 }
108 else
109 {
110 Debug.Log(
string.Format(
"Expected hologram of %1 not found, failing deployment!", poActionData.m_MainItem),
Type().
ToString());
111 return;
112 }
113 }
114 else
115 {
116 position = poActionData.m_Player.GetPosition();
117 orientation = poActionData.m_Player.GetOrientation();
118 position = position + (poActionData.m_Player.GetDirection() *
POSITION_OFFSET);
119 }
120
123 poActionData.m_MainItem.SetIsBeingPlaced(false);
125
126 entity_for_placing.OnPlacementComplete(poActionData.m_Player, position, orientation);
127 poActionData.m_Player.PlacingCompleteServer();
128
130 }
bool ActionUsesHologram()
void MoveEntityToFinalPosition(ActionData action_data, vector position, vector orientation)
const float POSITION_OFFSET
ref array< ItemBase > m_MovedItems
bool ClearJunctureEx(Man player, notnull EntityAI item)
proto native CGame GetGame()
proto native bool IsCLIParam(string param)
Returns if command line argument is present.