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

◆ OnAbort() [17/18]

override void WeaponStateBase::OnAbort ( WeaponEventBase e)
inlineprivate

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

503 {
504 super.OnAbort(e);
505
506 EntityAI leftHandItem = e.m_player.GetInventory().FindAttachment(InventorySlots.LEFTHAND);
507 Magazine mag = Magazine.Cast(leftHandItem);
508
509 if (mag)
510 {
511 if (m_newMagazine)
512 e.m_player.GetInventory().ClearInventoryReservationEx( m_newMagazine , null );
513 if (m_oldMagazine)
514 e.m_player.GetInventory().ClearInventoryReservationEx( m_oldMagazine , null );
515
516 InventoryLocation il = new InventoryLocation();
517
518 e.m_player.GetInventory().FindFreeLocationFor(mag, FindInventoryLocationType.CARGO, il);
519
520 if (!il.IsValid())
521 {
522 if (DayZPlayerUtils.HandleDropMagazine(e.m_player, mag))
523 {
524 if (LogManager.IsWeaponLogEnable()) { wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " DetachOldMagazine, ok - no inventory space for old magazine - dropped to ground - abort"); }
525 }
526 else
527 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " DetachOldMagazine, error - cannot drop magazine from left hand after not found inventory space for old magazine - abort");
528
529 }
530 else
531 {
532 InventoryLocation oldSrc = new InventoryLocation();
533 mag.GetInventory().GetCurrentInventoryLocation(oldSrc);
534
535 if (GameInventory.LocationSyncMoveEntity(oldSrc, il))
536 {
537 if (LogManager.IsWeaponLogEnable()) { wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " DetachOldMagazine, ok - old magazine removed from wpn (LHand->inv) - abort"); }
538 }
539 else
540 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " DetachOldMagazine, error - cannot remove old mag from wpn - abort");
541 }
542 }
543 }
class LogManager EntityAI
void wpnDebugPrint(string s)
Определения Debug.c:9
void DayZPlayerUtils()
cannot be instantiated
Определения DayZPlayerUtils.c:465
FindInventoryLocationType
flags for searching locations in inventory
Определения InventoryLocation.c:17
proto native bool IsValid()
verify current set inventory location
DayZPlayer m_player
Определения Events.c:37
Weapon_Base m_weapon
Определения WeaponStateBase.c:12
Magazine m_oldMagazine
Magazine m_newMagazine
magazine that will be detached
Определения WeaponAttachMagazine.c:3
class LOD Object
void Error(string err)
Messagebox with error message.
Определения EnDebug.c:90

Перекрестные ссылки DayZPlayerUtils(), Error(), InventoryLocation::IsValid(), LogManager::IsWeaponLogEnable(), GameInventory::LocationSyncMoveEntity(), m_newMagazine, m_oldMagazine, WeaponEventBase::m_player, m_weapon и wpnDebugPrint().