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

◆ OnFinishProgressServer()

override void ActionDeployBase::OnFinishProgressServer ( ActionData action_data)
inlineprotected

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

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 // In case of placement action that requires hologram, look for it, or fail
85 {
86 if (poActionData.m_Player.GetHologramServer())
87 {
88 position = poActionData.m_Position;
89 orientation = poActionData.m_Orientation;
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
97 if (GetGame().IsMultiplayer())
98 poActionData.m_Player.GetHologramServer().CheckPowerSource();
99
100 #ifdef DEVELOPER
101 if (IsCLIParam("hologramLogs"))
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 //action does NOT require hologram in the first place, take player's info instead
115 {
116 position = poActionData.m_Player.GetPosition();
117 orientation = poActionData.m_Player.GetOrientation();
118 position = position + (poActionData.m_Player.GetDirection() * POSITION_OFFSET);
119 }
120
121 MoveEntityToFinalPosition(poActionData, position, orientation);
122 GetGame().ClearJunctureEx(poActionData.m_Player, entity_for_placing);
123 poActionData.m_MainItem.SetIsBeingPlaced(false);
124 poActionData.m_AlreadyPlaced = true;
125
126 entity_for_placing.OnPlacementComplete(poActionData.m_Player, position, orientation); //beware, this WILL fire on server before the item is moved to final position!
127 poActionData.m_Player.PlacingCompleteServer();
128
129 m_MovedItems.Clear();
130 }
class LogManager EntityAI
proto string ToString()
string Type
Определения JsonDataContaminatedArea.c:11
void Debug()
Определения UniversalTemperatureSource.c:349
bool ActionUsesHologram()
Определения ActionDeployBase.c:51
void MoveEntityToFinalPosition(ActionData action_data, vector position, vector orientation)
Определения ActionDeployBase.c:173
const float POSITION_OFFSET
Определения ActionDeployBase.c:21
ref array< ItemBase > m_MovedItems
Определения ActionDeployBase.c:23
bool ClearJunctureEx(Man player, notnull EntityAI item)
Определения Global/game.c:762
vector m_Orientation
Определения ActionDeployBase.c:4
bool m_AlreadyPlaced
Определения ActionDeployBase.c:5
vector m_Position
Определения ActionDeployBase.c:3
proto native CGame GetGame()
proto native bool IsCLIParam(string param)
Returns if command line argument is present.

Перекрестные ссылки ActionData, ActionUsesHologram(), CGame::ClearJunctureEx(), GetGame(), IsCLIParam(), Debug::Log(), PlaceObjectActionData::m_AlreadyPlaced, m_MovedItems, PlaceObjectActionData::m_Orientation, PlaceObjectActionData::m_Position, MoveEntityToFinalPosition(), POSITION_OFFSET, ToString(), Type и vector::Zero.