339 {
340 InventoryLocation src1, src2, dst1, dst2;
341 if (GameInventory.MakeSrcAndDstForSwap(item1, item2, src1, src2, dst1, dst2))
342 {
343 bool handled = false;
345 {
348 InventoryLocation fswap_dst2 = new InventoryLocation;
350 {
351 if (LogManager.IsInventoryHFSMLogEnable())
hndDebugPrint(
"[inv] HumanInventory::Swap HandEventForceSwap(" +
typename.EnumToString(
InventoryMode, mode) +
") IH=src1=" + InventoryLocation.DumpToStringNullSafe(src1) +
" src2=" + InventoryLocation.DumpToStringNullSafe(src2));
353 }
354 else
355 {
356 if (LogManager.IsInventoryHFSMLogEnable())
hndDebugPrint(
"[inv] HumanInventory::Swap HandEventSwap(" +
typename.EnumToString(
InventoryMode, mode) +
") src1=" + InventoryLocation.DumpToStringNullSafe(src1) +
"src2=" + InventoryLocation.DumpToStringNullSafe(src2));
358 }
359 handled = true;
360 break;
361 }
362
364 {
366 if (LogManager.IsInventoryHFSMLogEnable())
hndDebugPrint(
"[inv] HumanInventory::Swap HandEventSwap2(" +
typename.EnumToString(
InventoryMode, mode) +
") src1=" + InventoryLocation.DumpToStringNullSafe(src1) +
" IH=src2=" + InventoryLocation.DumpToStringNullSafe(src2));
368 handled = true;
369 break;
370 }
371
372 if (!handled)
373 return super.SwapEntities(mode, item1, item2);
374
375 return true;
376 }
377
378 Error(
"HumanInventory::SwapEntities: cannot create src1, src2, dst1, dst2");
379 return false;
380 }
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.