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;
154 string undergroundStashType;
155
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 {
165 stash.PlaceOnGround();
166 InventoryLocation ilj = new InventoryLocation;
167 stash.GetInventory().GetCurrentInventoryLocation(ilj);
168
169 if (GameInventory.LocationCanRemoveEntity(targetIL))
170 {
173
174 if (!
GetGame().IsMultiplayer())
175 {
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 {
190 }
191
192
193 MiscGameplayFunctions.DealEvinronmentAdjustedDmg(action_data.m_MainItem, action_data.m_Player, 10);
194 }
const int ECE_PLACE_ON_SURFACE
void ClearActionJuncture(ActionData action_data)
void ClearInventoryReservationEx(ActionData action_data)
bool ClearJunctureEx(Man player, notnull EntityAI item)
bool AddInventoryJunctureEx(Man player, notnull EntityAI item, InventoryLocation dst, bool test_dst_occupancy, int timeout_ms)
bool GetSurfaceDigPile(string surface, out string result)
proto void SurfaceUnderObject(notnull Object object, out string type, out int liquidType)
proto native CGame GetGame()