DayZ 1.29
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ SwapEntities()

override bool HumanInventory::SwapEntities ( InventoryMode mode,
notnull EntityAI item1,
notnull EntityAI item2 )
inlineprivate

returns item to previous location, if available

См. определение в файле HumanInventory.c строка 338

339 {
340 InventoryLocation src1, src2, dst1, dst2;
341 if (GameInventory.MakeSrcAndDstForSwap(item1, item2, src1, src2, dst1, dst2))
342 {
343 bool handled = false;
344 switch (src1.GetType())
345 {
346 case InventoryLocationType.HANDS:
348 InventoryLocation fswap_dst2 = new InventoryLocation;
349 if ( SwappingToPreviousLocation(item1, item2, fswap_dst2) )
350 {
351 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[inv] HumanInventory::Swap HandEventForceSwap(" + typename.EnumToString(InventoryMode, mode) + ") IH=src1=" + InventoryLocation.DumpToStringNullSafe(src1) + " src2=" + InventoryLocation.DumpToStringNullSafe(src2));
352 HandEvent(mode, new HandEventForceSwap(GetManOwner(), src1, src2, dst1, fswap_dst2));
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));
357 HandEvent(mode, new HandEventSwap(GetManOwner(), src1, src2, dst1, dst2));
358 }
359 handled = true;
360 break;
361 }
362
363 switch (src2.GetType())
364 {
365 case InventoryLocationType.HANDS:
366 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[inv] HumanInventory::Swap HandEventSwap2(" + typename.EnumToString(InventoryMode, mode) + ") src1=" + InventoryLocation.DumpToStringNullSafe(src1) + " IH=src2=" + InventoryLocation.DumpToStringNullSafe(src2));
367 HandEvent(mode, new HandEventSwap(GetManOwner(), src2, src1, dst2, dst1));
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)
Определения HandFSM.c:1
InventoryLocationType
types of Inventory Location
Определения InventoryLocation.c:4
Man GetManOwner()
Определения HumanInventory.c:102
bool HandEvent(InventoryMode mode, HandEventBase e)
Определения HumanInventory.c:134
bool SwappingToPreviousLocation(EntityAI item1, EntityAI item2, out InventoryLocation dst)
Определения HumanInventory.c:553
proto native int GetType()
returns type of InventoryLocation
void Error(string err)
Messagebox with error message.
Определения EnDebug.c:90

Перекрестные ссылки InventoryLocation::DumpToStringNullSafe(), Error(), GetManOwner(), InventoryLocation::GetType(), HandEvent(), hndDebugPrint(), LogManager::IsInventoryHFSMLogEnable(), GameInventory::MakeSrcAndDstForSwap() и SwappingToPreviousLocation().