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

◆ OnFinishProgressServer()

override void ActionDigInStash::OnFinishProgressServer ( ActionData action_data)
inlineprivate

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

132 {
133 EntityAI targetEntity = EntityAI.Cast(action_data.m_Target.GetObject());
134 if (!targetEntity)
135 {
136 ErrorEx("Cannot get entity=" + targetEntity);
137 return;
138 }
139
140 InventoryLocation targetIL = new InventoryLocation();
141 if (!targetEntity.GetInventory().GetCurrentInventoryLocation(targetIL))
142 {
143 ErrorEx("Cannot get inventory location of entity=" + targetEntity);
144 return;
145 }
146
147 EntityAI entityToCheck = targetEntity;
148 if (targetEntity.GetInventory().IsInCargo())
149 entityToCheck = action_data.m_Player;
150
151 int liquidType;
152 string surfaceType;
153 GetGame().SurfaceUnderObject(entityToCheck, surfaceType, liquidType);
154 string undergroundStashType;
155
156 GetGame().GetSurfaceDigPile(surfaceType, undergroundStashType);
157
158 if (undergroundStashType == "")
159 undergroundStashType = "UndergroundStash";
160
161 UndergroundStash stash = UndergroundStash.Cast(GetGame().CreateObjectEx(undergroundStashType, targetEntity.GetPosition(), ECE_PLACE_ON_SURFACE));
162 if (stash)
163 {
164 ClearActionJuncture(action_data);
165 stash.PlaceOnGround();
166 InventoryLocation ilj = new InventoryLocation;
167 stash.GetInventory().GetCurrentInventoryLocation(ilj);
168
169 if (GameInventory.LocationCanRemoveEntity(targetIL))
170 {
171 GetGame().AddInventoryJunctureEx(action_data.m_Player, targetEntity, ilj, true, 10000);
172 GetGame().ClearJunctureEx(action_data.m_Player, targetEntity);
173
174 if (!GetGame().IsMultiplayer())
175 {
176 ClearInventoryReservationEx(action_data);
177 action_data.m_Player.LocalTakeEntityToTargetCargo(stash, targetEntity);
178 }
179 else
180 action_data.m_Player.ServerTakeEntityToTargetCargo(stash, targetEntity);
181 }
182 else
183 {
184 Debug.Log(string.Format("Cannot remove entity=%1 obj from current location=%2", targetEntity, InventoryLocation.DumpToStringNullSafe(targetIL)));
185 }
186 }
187 else
188 {
189 ErrorEx("Stash not spawned!");
190 }
191
192 //Apply tool damage
193 MiscGameplayFunctions.DealEvinronmentAdjustedDmg(action_data.m_MainItem, action_data.m_Player, 10);
194 }
class LogManager EntityAI
const int ECE_PLACE_ON_SURFACE
Определения CentralEconomy.c:37
void Debug()
Определения UniversalTemperatureSource.c:349
void ClearActionJuncture(ActionData action_data)
Определения ActionBase.c:1083
void ClearInventoryReservationEx(ActionData action_data)
Определения ActionBase.c:1025
bool ClearJunctureEx(Man player, notnull EntityAI item)
Определения Game.c:762
bool AddInventoryJunctureEx(Man player, notnull EntityAI item, InventoryLocation dst, bool test_dst_occupancy, int timeout_ms)
Определения Game.c:741
bool GetSurfaceDigPile(string surface, out string result)
Определения Game.c:1161
proto void SurfaceUnderObject(notnull Object object, out string type, out int liquidType)
proto native CGame GetGame()
enum ShapeType ErrorEx

Перекрестные ссылки ActionData, CGame::AddInventoryJunctureEx(), ActionBase::ClearActionJuncture(), ActionBase::ClearInventoryReservationEx(), CGame::ClearJunctureEx(), InventoryLocation::DumpToStringNullSafe(), ECE_PLACE_ON_SURFACE, ErrorEx, GetGame(), CGame::GetSurfaceDigPile(), GameInventory::LocationCanRemoveEntity(), Debug::Log() и CGame::SurfaceUnderObject().