132 {
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 {
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 {
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 {
187 }
188
189
190 MiscGameplayFunctions.DealEvinronmentAdjustedDmg(action_data.m_MainItem, action_data.m_Player, 10);
191 }
const int ECE_PLACE_ON_SURFACE
void ClearActionJuncture(ActionData action_data)
void ClearInventoryReservationEx(ActionData action_data)