76 if (!poActionData.m_MainItem)
79 EntityAI entity_for_placing = poActionData.m_MainItem;
86 if (poActionData.m_Player.GetHologramServer())
88 position = poActionData.m_Position;
89 orientation = poActionData.m_Orientation;
91 poActionData.m_Player.GetHologramServer().EvaluateCollision(poActionData.m_MainItem);
92 if (
GetGame().IsMultiplayer() && poActionData.m_Player.GetHologramServer().IsColliding())
95 poActionData.m_Player.GetHologramServer().PlaceEntity(entity_for_placing);
98 poActionData.m_Player.GetHologramServer().CheckPowerSource();
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");
110 Debug.Log(
string.Format(
"Expected hologram of %1 not found, failing deployment!", poActionData.m_MainItem),
Type().
ToString());
116 position = poActionData.m_Player.GetPosition();
117 orientation = poActionData.m_Player.GetOrientation();
118 position = position + (poActionData.m_Player.GetDirection() *
POSITION_OFFSET);
122 GetGame().ClearJunctureEx(poActionData.m_Player, entity_for_placing);
123 poActionData.m_MainItem.SetIsBeingPlaced(
false);
124 poActionData.m_AlreadyPlaced =
true;
126 entity_for_placing.OnPlacementComplete(poActionData.m_Player, position, orientation);
127 poActionData.m_Player.PlacingCompleteServer();
175 if (action_data.m_MainItem.IsBasebuildingKit())
178 EntityAI entity_for_placing = action_data.m_MainItem;
179 vector rotation_matrix[3];
184 Math3D.YawPitchRollMatrix(orientation, rotation_matrix);
185 Math3D.MatrixToQuat(rotation_matrix, direction);
187 if (entity_for_placing.GetInventory().GetCurrentInventoryLocation(source))
189 destination.SetGroundEx(entity_for_placing, position, direction);
192 action_data.m_Player.ServerTakeToDst(source, destination);