276 {
277 InventoryLocation src1, src2, dst1, dst2;
278 if (GameInventory.MakeSrcAndDstForSwap(item1, item2, src1, src2, dst1, dst2))
279 {
280 bool handled = false;
282 {
285 InventoryLocation fswap_dst2 = new InventoryLocation;
287 {
288 if (LogManager.IsInventoryHFSMLogEnable())
hndDebugPrint(
"[inv] HumanInventory::Swap HandEventForceSwap(" +
typename.EnumToString(
InventoryMode, mode) +
") IH=src1=" + InventoryLocation.DumpToStringNullSafe(src1) +
" src2=" + InventoryLocation.DumpToStringNullSafe(src2));
290 }
291 else
292 {
293 if (LogManager.IsInventoryHFSMLogEnable())
hndDebugPrint(
"[inv] HumanInventory::Swap HandEventSwap(" +
typename.EnumToString(
InventoryMode, mode) +
") src1=" + InventoryLocation.DumpToStringNullSafe(src1) +
"src2=" + InventoryLocation.DumpToStringNullSafe(src2));
295 }
296 handled = true;
297 break;
298 }
299
301 {
303 if (LogManager.IsInventoryHFSMLogEnable())
hndDebugPrint(
"[inv] HumanInventory::Swap HandEventSwap2(" +
typename.EnumToString(
InventoryMode, mode) +
") src1=" + InventoryLocation.DumpToStringNullSafe(src1) +
" IH=src2=" + InventoryLocation.DumpToStringNullSafe(src2));
305 handled = true;
306 break;
307 }
308
309 if (!handled)
310 return super.SwapEntities(mode, item1, item2);
311
312 return true;
313 }
314
315 Error(
"HumanInventory::SwapEntities: cannot create src1, src2, dst1, dst2");
316 return false;
317 }
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.