DayZ 1.27
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 строка 328

329 {
330 InventoryLocation src1, src2, dst1, dst2;
331 if (GameInventory.MakeSrcAndDstForSwap(item1, item2, src1, src2, dst1, dst2))
332 {
333 bool handled = false;
334 switch (src1.GetType())
335 {
336 case InventoryLocationType.HANDS:
338 InventoryLocation fswap_dst2 = new InventoryLocation;
339 if ( SwappingToPreviousLocation(item1, item2, fswap_dst2) )
340 {
341 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[inv] HumanInventory::Swap HandEventForceSwap(" + typename.EnumToString(InventoryMode, mode) + ") IH=src1=" + InventoryLocation.DumpToStringNullSafe(src1) + " src2=" + InventoryLocation.DumpToStringNullSafe(src2));
342 HandEvent(mode, new HandEventForceSwap(GetManOwner(), src1, src2, dst1, fswap_dst2));
343 }
344 else
345 {
346 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[inv] HumanInventory::Swap HandEventSwap(" + typename.EnumToString(InventoryMode, mode) + ") src1=" + InventoryLocation.DumpToStringNullSafe(src1) + "src2=" + InventoryLocation.DumpToStringNullSafe(src2));
347 HandEvent(mode, new HandEventSwap(GetManOwner(), src1, src2, dst1, dst2));
348 }
349 handled = true;
350 break;
351 }
352
353 switch (src2.GetType())
354 {
355 case InventoryLocationType.HANDS:
356 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[inv] HumanInventory::Swap HandEventSwap2(" + typename.EnumToString(InventoryMode, mode) + ") src1=" + InventoryLocation.DumpToStringNullSafe(src1) + " IH=src2=" + InventoryLocation.DumpToStringNullSafe(src2));
357 HandEvent(mode, new HandEventSwap(GetManOwner(), src2, src1, dst2, dst1));
358 handled = true;
359 break;
360 }
361
362 if (!handled)
363 return super.SwapEntities(mode, item1, item2);
364
365 return true;
366 }
367
368 Error("HumanInventory::SwapEntities: cannot create src1, src2, dst1, dst2");
369 return false;
370 }
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
Определения Inventory.c:22
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:540
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().

Используется в EntityAI::SwapEntitiesImpl().