320 {
321 InventoryLocation src1, src2, dst1;
322 if (GameInventory.MakeSrcAndDstForForceSwap(item1, item2, src1, src2, dst1, item2_dst))
323 {
324 GameInventory manOwnerInventory =
GetManOwner().GetInventory();
325
326 if (LogManager.IsInventoryHFSMLogEnable())
hndDebugPrint(
"[inv] HumanInventory::FSwap(" +
typename.EnumToString(
InventoryMode, mode) +
") dst1=" + InventoryLocation.DumpToStringNullSafe(dst1)+
" dst2=" + InventoryLocation.DumpToStringNullSafe(item2_dst));
327 bool handled = false;
329 {
331 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));
335 handled = true;
336 break;
337
338 }
339
341 {
344 InventoryLocation fswap_dst2 = new InventoryLocation;
346 {
347 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));
349 }
350 else
351 {
352 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));
354 }
355
356 handled = true;
357 break;
358 }
359
360 bool returnValue = true;
361
362 if (!handled)
363 returnValue = super.ForceSwapEntities(mode, item1, item2, item2_dst);
364
365 return returnValue;
366 }
367
368 Error(
"HumanInventory::ForceSwapEntities: No inventory location");
369 return false;
370 }
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.