373 {
374 InventoryLocation src1, src2, dst1;
375 if (GameInventory.MakeSrcAndDstForForceSwap(item1, item2, src1, src2, dst1, item2_dst))
376 {
377 GameInventory manOwnerInventory =
GetManOwner().GetInventory();
378
379 if (LogManager.IsInventoryHFSMLogEnable())
hndDebugPrint(
"[inv] HumanInventory::FSwap(" +
typename.EnumToString(
InventoryMode, mode) +
") dst1=" + InventoryLocation.DumpToStringNullSafe(dst1)+
" dst2=" + InventoryLocation.DumpToStringNullSafe(item2_dst));
380 bool handled = false;
382 {
384 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));
388 handled = true;
389 break;
390
391 }
392
394 {
397 InventoryLocation fswap_dst2 = new InventoryLocation;
399 {
400 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));
402 }
403 else
404 {
405 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));
407 }
408
409 handled = true;
410 break;
411 }
412
413 bool returnValue = true;
414
415 if (!handled)
416 returnValue = super.ForceSwapEntities(mode, item1, item2, item2_dst);
417
418 return returnValue;
419 }
420
421 Error(
"HumanInventory::ForceSwapEntities: No inventory location");
422 return false;
423 }
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.