DayZ 1.30
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 строка 275

276 {
277 InventoryLocation src1, src2, dst1, dst2;
278 if (GameInventory.MakeSrcAndDstForSwap(item1, item2, src1, src2, dst1, dst2))
279 {
280 bool handled = false;
281 switch (src1.GetType())
282 {
283 case InventoryLocationType.HANDS:
285 InventoryLocation fswap_dst2 = new InventoryLocation;
286 if ( SwappingToPreviousLocation(item1, item2, fswap_dst2) )
287 {
288 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[inv] HumanInventory::Swap HandEventForceSwap(" + typename.EnumToString(InventoryMode, mode) + ") IH=src1=" + InventoryLocation.DumpToStringNullSafe(src1) + " src2=" + InventoryLocation.DumpToStringNullSafe(src2));
289 HandEvent(mode, new HandEventForceSwap(GetManOwner(), src1, src2, dst1, fswap_dst2));
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));
294 HandEvent(mode, new HandEventSwap(GetManOwner(), src1, src2, dst1, dst2));
295 }
296 handled = true;
297 break;
298 }
299
300 switch (src2.GetType())
301 {
302 case InventoryLocationType.HANDS:
303 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[inv] HumanInventory::Swap HandEventSwap2(" + typename.EnumToString(InventoryMode, mode) + ") src1=" + InventoryLocation.DumpToStringNullSafe(src1) + " IH=src2=" + InventoryLocation.DumpToStringNullSafe(src2));
304 HandEvent(mode, new HandEventSwap(GetManOwner(), src2, src1, dst2, dst1));
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)
Определения 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:490
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().