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.
232 {
234 if (!ScriptInputUserData.CanStoreInputUserData())
235 {
236 Print(
"[inv] PredictiveMoveItemFromHandsToInventory input data not sent yet, cannot allow another input action");
237 return;
238 }
239
242
245
248 if (entityInHands.m_OldLocation && entityInHands.m_OldLocation.IsValid())
249 {
250 InventoryLocation invLoc = new InventoryLocation;
251 entityInHands.GetInventory().GetCurrentInventoryLocation(invLoc);
252
254 EntityAI oldLocationParent = entityInHands.m_OldLocation.GetParent();
255 if (oldLocationParent && oldLocationParent.GetHierarchyRootPlayer())
256 {
259 {
261 if (!oldLocEntity && humanInventory.
TakeToDst(invMode, invLoc, entityInHands.m_OldLocation))
262 {
264 return;
265 }
266 else
267 {
268 InventoryLocation newLocation = new InventoryLocation;
270 {
271 if (humanInventory.
TakeToDst(invMode, invLoc, newLocation))
272 {
274 return;
275 }
276 }
277 }
278 }
279 }
280 }
281
284 }
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.