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

◆ OnAbort() [21/22]

override void WeaponStateBase::OnAbort ( WeaponEventBase e)
inlineprivate

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

767 {
768 super.OnAbort(e);
769
770 EntityAI leftHandItem = e.m_player.GetInventory().FindAttachment(InventorySlots.LEFTHAND);
771 Magazine mag = Magazine.Cast(leftHandItem);
772
773 if (mag)
774 {
775 if (m_newMagazine)
776 e.m_player.GetInventory().ClearInventoryReservationEx( m_newMagazine , null );
777 if (m_oldMagazine)
778 e.m_player.GetInventory().ClearInventoryReservationEx( m_oldMagazine , null );
779
780 InventoryLocation il = new InventoryLocation();
781
782 e.m_player.GetInventory().FindFreeLocationFor(mag, FindInventoryLocationType.CARGO, il);
783
784 if (!il.IsValid())
785 {
786 if (DayZPlayerUtils.HandleDropMagazine(e.m_player, mag))
787 {
788 if (LogManager.IsWeaponLogEnable()) { wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponReplacingMagAndChamberNextOpenBoltCharged, ok - no inventory space for old magazine - dropped to ground - abort"); }
789 }
790 else
791 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponReplacingMagAndChamberNextOpenBoltCharged, error - cannot drop magazine from left hand after not found inventory space for old magazine - abort");
792
793 }
794 else
795 {
796 InventoryLocation oldSrc = new InventoryLocation();
797 mag.GetInventory().GetCurrentInventoryLocation(oldSrc);
798
799 if (GameInventory.LocationSyncMoveEntity(oldSrc, il))
800 {
801 if (LogManager.IsWeaponLogEnable()) { wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponReplacingMagAndChamberNextOpenBoltCharged, ok - old magazine removed from wpn (LHand->inv) - abort"); }
802 }
803 else
804 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponReplacingMagAndChamberNextOpenBoltCharged, error - cannot remove old mag from wpn - abort");
805 }
806 }
807 }
class LogManager EntityAI
void wpnDebugPrint(string s)
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().