DayZ 1.29
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 g_Game.SurfaceUnderObject(entityToCheck, surfaceType, liquidType);
154 string undergroundStashType;
155
156 g_Game.GetSurfaceDigPile(surfaceType, undergroundStashType);
157
158 if (undergroundStashType == "")
159 undergroundStashType = "UndergroundStash";
160
161 UndergroundStash stash = UndergroundStash.Cast(g_Game.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 if (!g_Game.IsMultiplayer())
172 {
173 ClearInventoryReservationEx(action_data);
174 action_data.m_Player.LocalTakeEntityToTargetCargo(stash, targetEntity);
175 }
176 else
177 action_data.m_Player.ServerTakeEntityToTargetCargo(stash, targetEntity);
178 }
179 else
180 {
181 Debug.Log(string.Format("Cannot remove entity=%1 obj from current location=%2", targetEntity, InventoryLocation.DumpToStringNullSafe(targetIL)));
182 }
183 }
184 else
185 {
186 ErrorEx("Stash not spawned!");
187 }
188
189 //Apply tool damage
190 MiscGameplayFunctions.DealEvinronmentAdjustedDmg(action_data.m_MainItem, action_data.m_Player, 10);
191 }
class LogManager EntityAI
string Debug()
Определения CachedEquipmentStorageBase.c:29
const int ECE_PLACE_ON_SURFACE
Определения CentralEconomy.c:37
DayZGame g_Game
Определения DayZGame.c:3942
void ClearActionJuncture(ActionData action_data)
Определения ActionBase.c:1104
void ClearInventoryReservationEx(ActionData action_data)
Определения ActionBase.c:1040
enum ShapeType ErrorEx

Перекрестные ссылки ActionData, ActionBase::ClearActionJuncture(), ActionBase::ClearInventoryReservationEx(), InventoryLocation::DumpToStringNullSafe(), ECE_PLACE_ON_SURFACE, ErrorEx, g_Game, GameInventory::LocationCanRemoveEntity() и Debug::Log().