383 {
384 InventoryLocation src1, src2, dst1;
385 if (GameInventory.MakeSrcAndDstForForceSwap(item1, item2, src1, src2, dst1, item2_dst))
386 {
387 GameInventory manOwnerInventory =
GetManOwner().GetInventory();
388
389 if (LogManager.IsInventoryHFSMLogEnable())
hndDebugPrint(
"[inv] HumanInventory::FSwap(" +
typename.EnumToString(
InventoryMode, mode) +
") dst1=" + InventoryLocation.DumpToStringNullSafe(dst1)+
" dst2=" + InventoryLocation.DumpToStringNullSafe(item2_dst));
390 bool handled = false;
392 {
394 if (LogManager.IsInventoryHFSMLogEnable())
hndDebugPrint(
"[inv] HumanInventory::FSwap-HND@1(" +
typename.EnumToString(
InventoryMode, mode) +
") src1=" + InventoryLocation.DumpToStringNullSafe(src1) +
" src2=" + InventoryLocation.DumpToStringNullSafe(src2) +
" dst1=" + InventoryLocation.DumpToStringNullSafe(dst1) +
" item2_dst=" + InventoryLocation.DumpToStringNullSafe(item2_dst));
398 handled = true;
399 break;
400
401 }
402
404 {
407 InventoryLocation fswap_dst2 = new InventoryLocation;
409 {
410 if (LogManager.IsInventoryHFSMLogEnable())
hndDebugPrint(
"[inv] HumanInventory::FSwap-PREV(" +
typename.EnumToString(
InventoryMode, mode) +
") src1=" + InventoryLocation.DumpToStringNullSafe(src1) +
" src2=" + InventoryLocation.DumpToStringNullSafe(src2) +
" dst1=" + InventoryLocation.DumpToStringNullSafe(dst1) +
" fswap_dst2=" + InventoryLocation.DumpToStringNullSafe(fswap_dst2));
412 }
413 else
414 {
415 if (LogManager.IsInventoryHFSMLogEnable())
hndDebugPrint(
"[inv] HumanInventory::FSwap-HND@2(" +
typename.EnumToString(
InventoryMode, mode) +
") src1=" + InventoryLocation.DumpToStringNullSafe(src1) +
" src2=" + InventoryLocation.DumpToStringNullSafe(src2) +
" dst1=" + InventoryLocation.DumpToStringNullSafe(dst1) +
" item2_dst=" + InventoryLocation.DumpToStringNullSafe(item2_dst));
417 }
418
419 handled = true;
420 break;
421 }
422
423 bool returnValue = true;
424
425 if (!handled)
426 returnValue = super.ForceSwapEntities(mode, item1, item2, item2_dst);
427
428 return returnValue;
429 }
430
431 Error(
"HumanInventory::ForceSwapEntities: No inventory location");
432 return false;
433 }
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
void HandEventBase(Man p=null, InventoryLocation src=null)
void hndDebugPrint(string s)
InventoryLocationType
types of Inventory Location
override bool ReserveInventory()
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.