329 {
330 InventoryLocation src1, src2, dst1, dst2;
331 if (GameInventory.MakeSrcAndDstForSwap(item1, item2, src1, src2, dst1, dst2))
332 {
333 bool handled = false;
335 {
338 InventoryLocation fswap_dst2 = new InventoryLocation;
340 {
341 if (LogManager.IsInventoryHFSMLogEnable())
hndDebugPrint(
"[inv] HumanInventory::Swap HandEventForceSwap(" +
typename.EnumToString(
InventoryMode, mode) +
") IH=src1=" + InventoryLocation.DumpToStringNullSafe(src1) +
" src2=" + InventoryLocation.DumpToStringNullSafe(src2));
343 }
344 else
345 {
346 if (LogManager.IsInventoryHFSMLogEnable())
hndDebugPrint(
"[inv] HumanInventory::Swap HandEventSwap(" +
typename.EnumToString(
InventoryMode, mode) +
") src1=" + InventoryLocation.DumpToStringNullSafe(src1) +
"src2=" + InventoryLocation.DumpToStringNullSafe(src2));
348 }
349 handled = true;
350 break;
351 }
352
354 {
356 if (LogManager.IsInventoryHFSMLogEnable())
hndDebugPrint(
"[inv] HumanInventory::Swap HandEventSwap2(" +
typename.EnumToString(
InventoryMode, mode) +
") src1=" + InventoryLocation.DumpToStringNullSafe(src1) +
" IH=src2=" + InventoryLocation.DumpToStringNullSafe(src2));
358 handled = true;
359 break;
360 }
361
362 if (!handled)
363 return super.SwapEntities(mode, item1, item2);
364
365 return true;
366 }
367
368 Error(
"HumanInventory::SwapEntities: cannot create src1, src2, dst1, dst2");
369 return false;
370 }
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
void hndDebugPrint(string s)
InventoryLocationType
types of Inventory Location
bool HandEvent(InventoryMode mode, HandEventBase e)
bool SwappingToPreviousLocation(EntityAI item1, EntityAI item2, out InventoryLocation dst)
proto native int GetType()
returns type of InventoryLocation
void Error(string err)
Messagebox with error message.