ToDo: Old system method. Might should be adjusted to new system at some point.
This should not happen after clearing inventory reservation but just in case handle also getting a new location if the old location is obscured by an item.
239 {
241 if (!ScriptInputUserData.CanStoreInputUserData())
242 {
243 Print(
"[inv] PredictiveMoveItemFromHandsToInventory input data not sent yet, cannot allow another input action");
244 return;
245 }
246
249
252
255 if (entityInHands.m_OldLocation && entityInHands.m_OldLocation.IsValid())
256 {
257 InventoryLocation invLoc = new InventoryLocation;
258 entityInHands.GetInventory().GetCurrentInventoryLocation(invLoc);
259
261 EntityAI oldLocationParent = entityInHands.m_OldLocation.GetParent();
262 if (oldLocationParent && oldLocationParent.GetHierarchyRootPlayer())
263 {
266 {
268 if (!oldLocEntity && humanInventory.
TakeToDst(invMode, invLoc, entityInHands.m_OldLocation))
269 {
271 return;
272 }
273 else
274 {
275 InventoryLocation newLocation = new InventoryLocation;
277 {
278 if (humanInventory.
TakeToDst(invMode, invLoc, newLocation))
279 {
281 return;
282 }
283 }
284 }
285 }
286 }
287 }
288
291 }
void syncDebugPrint(string s)
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
FindInventoryLocationType
flags for searching locations in inventory
void UpdateInventoryMenu()
proto native EntityAI GetEntityInHands()
Returns the current entity in hands.
bool NeedInventoryJunctureFromServer(notnull EntityAI item, EntityAI currParent, EntityAI newParent)
proto native HumanInventory GetHumanInventory()
static proto native EntityAI LocationGetEntity(notnull InventoryLocation inv_loc)
static proto native bool ClearInventoryReservation(EntityAI item, InventoryLocation dst)
static proto native bool LocationCanMoveEntity(notnull InventoryLocation src, notnull InventoryLocation dst)
queries if the entity contained in inv_loc.m_item can be moved to another location This is a shorthan...
proto native bool FindFreeLocationFor(notnull EntityAI item, FindInventoryLocationType flags, out notnull InventoryLocation loc)
FindFreeLocationFor.
override bool TakeEntityToInventory(InventoryMode mode, FindInventoryLocationType flags, notnull EntityAI item)
override bool TakeToDst(InventoryMode mode, notnull InventoryLocation src, notnull InventoryLocation dst)
override string GetDebugName()
proto void Print(void var)
Prints content of variable to console/log.