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 InventoryLocation ilj = new InventoryLocation();
166 stash.GetInventory().GetCurrentInventoryLocation(ilj);
167
168 if (GameInventory.LocationCanRemoveEntity(targetIL))
169 {
170 if (!
g_Game.IsMultiplayer())
171 {
173 action_data.
m_Player.LocalTakeEntityToTargetCargo(stash, targetEntity);
174 }
175 else
176 action_data.
m_Player.ServerTakeEntityToTargetCargo(stash, targetEntity);
177 }
178 else
179 {
180 Debug.Log(
string.Format(
"Cannot remove entity=%1 obj from current location=%2", targetEntity, InventoryLocation.DumpToStringNullSafe(targetIL)));
181 }
182 }
183 else
184 {
186 }
187
188
189 MiscGameplayFunctions.DealEvinronmentAdjustedDmg(action_data.
m_MainItem, action_data.
m_Player, 10);
190 }
void ClearInventoryReservationEx(ActionData action_data)
void ClearActionJuncture(ActionData action_data)
const int ECE_PLACE_ON_SURFACE
ref ActionTarget m_Target