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 {
779
780 InventoryLocation il = new InventoryLocation();
781
783
785 {
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 }
void wpnDebugPrint(string s)
void DayZPlayerUtils()
cannot be instantiated
FindInventoryLocationType
flags for searching locations in inventory
proto native bool IsValid()
verify current set inventory location
Magazine m_newMagazine
magazine that will be detached
void Error(string err)
Messagebox with error message.