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

◆ OnAbort()

override void OnAbort ( WeaponEventBase e)

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

789 {
790 bool done = false;
791 if (m_srcMagazine)
792 {
793 e.m_player.GetInventory().ClearInventoryReservationEx( m_srcMagazine , m_srcMagazinePrevLocation );
794
795 InventoryLocation leftHandIl = new InventoryLocation;
796 m_srcMagazine.GetInventory().GetCurrentInventoryLocation(leftHandIl);
797 if (leftHandIl.IsValid())
798 {
800 {
802 {
804 {
806 {
807 if (LogManager.IsWeaponLogEnable()) { wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " ChamberMultiBullet, ok - ammo pile removed from left hand to previous location (LHand->inv) - abort"); }
808 done = true;
809 }
810 }
811 }
812 }
813
814 if( !done)
815 {
817 e.m_player.GetInventory().FindFreeLocationFor( m_srcMagazine, FindInventoryLocationType.CARGO, il );
818
819 if(!il || !il.IsValid())
820 {
821 if (DayZPlayerUtils.HandleDropMagazine(e.m_player, m_srcMagazine))
822 {
823 if (LogManager.IsWeaponLogEnable()) { wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " ChamberMultiBullet, ok - no inventory space for ammo pile - dropped to ground - abort"); }
824 }
825 else
826 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " ChamberMultiBullet, error - cannot drop ammo pile from left hand after not found inventory space for ammo pile - abort");
827
828 }
829 else
830 {
831 if (GameInventory.LocationSyncMoveEntity(leftHandIl, il))
832 {
833 if (LogManager.IsWeaponLogEnable()) { wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " ChamberMultiBullet, ok - ammo pile removed from left hand (LHand->inv) - abort"); }
834 }
835 else
836 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " ChamberMultiBullet, error - cannot remove ammo pile from wpn - abort");
837 }
838 }
839 }
840 }
841
842 super.OnAbort(e);
843 m_srcMagazine = NULL;
844 m_chamber.m_srcMagazine = NULL;
846 }
void wpnDebugPrint(string s)
Определения Debug.c:9
void DayZPlayerUtils()
cannot be instantiated
Определения DayZPlayerUtils.c:465
class WeaponGuardIsDestroyed extends WeaponGuardBase m_weapon
Определения Guards.c:604
FindInventoryLocationType
flags for searching locations in inventory
Определения InventoryLocation.c:17
Magazine m_srcMagazine
Определения WeaponChambering.c:634
ref InventoryLocation m_srcMagazinePrevLocation
source of the cartridge
Определения WeaponChambering.c:635
ref WeaponChambering_Base m_chamber
Определения WeaponChambering.c:639
static proto native bool LocationSyncMoveEntity(notnull InventoryLocation src_loc, notnull InventoryLocation dst_loc)
synchronously removes item from current inventory location and adds it to destination no anims involv...
static proto native bool LocationCanMoveEntity(notnull InventoryLocation src, notnull InventoryLocation dst)
queries if the entity contained in inv_loc.m_item can be moved to another location This is a shorthan...
script counterpart to engine's class Inventory
Определения Inventory.c:79
proto native bool IsValid()
verify current set inventory location
proto native vector GetPos()
returns position of item in world if type is Ground
InventoryLocation.
Определения InventoryLocation.c:29
static bool IsWeaponLogEnable()
Определения Debug.c:718
Определения Debug.c:594
Определения ObjectTyped.c:2
DayZPlayer m_player
Определения Events.c:37
const float MAX_DROP_MAGAZINE_DISTANCE_SQ
Определения WeaponManager.c:3
Определения WeaponManager.c:2
static proto native float DistanceSq(vector v1, vector v2)
Returns the square distance between tips of two 3D vectors.
Определения EnConvert.c:106
void Error(string err)
Messagebox with error message.
Определения EnDebug.c:90

Перекрестные ссылки DayZPlayerUtils(), vector::DistanceSq(), Error(), InventoryLocation::GetPos(), InventoryLocation::IsValid(), LogManager::IsWeaponLogEnable(), GameInventory::LocationCanMoveEntity(), GameInventory::LocationSyncMoveEntity(), m_chamber, WeaponEventBase::m_player, m_srcMagazine, m_srcMagazinePrevLocation, m_weapon, WeaponManager::MAX_DROP_MAGAZINE_DISTANCE_SQ и wpnDebugPrint().