16 if (!m_newSrc.IsValid())
17 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" RemoveNewMagazineFromInventory m_newSrc=invalid, item not in bubble?");
19 if (m_newMagazine && m_newSrc && m_newSrc.IsValid())
22 m_newMagazine.GetInventory().GetCurrentInventoryLocation(
curr);
37 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" RemoveNewMagazineFromInventory, error - cannot new remove mag from inv");
41 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" RemoveNewMagazineFromInventory, error - no magazines configured for replace (m_old=m_new=NULL)");
68 if (!
ctx.Write(m_newMagazine))
70 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" RemoveNewMagazineFromInventory.SaveCurrentFSMState: cannot write m_newMagazine for weapon=" +
m_weapon);
76 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" RemoveNewMagazineFromInventory.SaveCurrentFSMState: cannot write m_newSrc for weapon=" +
m_weapon);
84 if (!
super.LoadCurrentFSMState(
ctx, version))
87 if (!
ctx.Read(m_newMagazine))
89 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" RemoveNewMagazineFromInventory.LoadCurrentFSMState: cannot read m_newMagazine for weapon=" +
m_weapon);
95 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" RemoveNewMagazineFromInventory.LoadCurrentFSMState: cannot read m_newSrc for weapon=" +
m_weapon);
160 m_fsm.SetInitialState(
m_start);
170 mag.GetInventory().GetCurrentInventoryLocation(
newSrc);
180 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" WeaponAttachMagazine, error - cannot new remove mag from inv");
184 m_attach.m_newMagazine =
mag;
185 m_attach.m_newDst =
il;
197 e.m_player.GetInventory().ClearInventoryReservationEx(
mag,
null);
201 if (!
il || !
il.IsValid())
208 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" WeaponAttachMagazine, error - cannot drop magazine from left hand after not found inventory space for old magazine");
214 mag.GetInventory().GetCurrentInventoryLocation(
oldSrc);
221 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" WeaponAttachMagazine, error - cannot remove old mag from wpn");
void wpnDebugPrint(string s)
void DayZPlayerUtils()
cannot be instantiated
class WeaponGuardIsDestroyed extends WeaponGuardBase m_weapon
void WeaponGuardHasAmmo(Weapon_Base w=NULL)
FindInventoryLocationType
flags for searching locations in inventory
bool OptionalLocationReadFromContext(out InventoryLocation loc, notnull ParamsReadContext ctx)
InventoryLocationType
types of Inventory Location
bool OptionalLocationWriteToContext(InventoryLocation loc, notnull ParamsWriteContext ctx)
enum FSMTransition WeaponTransition
ref WeaponStateBase m_start
class WeaponEndAction extends WeaponStartAction m_action
ref WeaponChambering_Base m_chamber
ref WeaponEjectCasingMultiMuzzle m_eject
attach mag in LH into weapon
script counterpart to engine's class Inventory
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...
provides access to slot configuration
static bool IsWeaponLogEnable()
override void OnEntry(WeaponEventBase e)
Serialization general interface. Serializer API works with:
signalize mechanism manipulation
weapon finite state machine
simple class starting animation action specified by m_action and m_actionType
represent weapon state base
void AttachNewMagazine(Weapon_Base w=NULL, WeaponStateBase parent=NULL)
ref InventoryLocation m_newSrc
magazine that will be removed from inventory
int m_actionType
action to be played
void RemoveNewMagazineFromInventory(Weapon_Base w=NULL, WeaponStateBase parent=NULL)
void WeaponStartAction(Weapon_Base w=NULL, WeaponStateBase parent=NULL, WeaponActions action=WeaponActions.NONE, int actionType=-1)
specific action sub-type
ref AttachNewMagazine m_attach
void WeaponAttachMagazine(Weapon_Base w=NULL, WeaponStateBase parent=NULL, WeaponActions action=WeaponActions.NONE, int actionType=-1)
ref WeaponChamberFromAttMag_W4T m_chamber
override void OnEntry(WeaponEventBase e)
ref WeaponCharging_CK m_onCK
ref WeaponStateBase m_start
source of the cartridge
override bool LoadCurrentFSMState(ParamsReadContext ctx, int version)
ref WeaponEjectCasing m_eject
override void OnAbort(WeaponEventBase e)
Magazine m_newMagazine
magazine that will be detached
void WeaponEjectCasing(Weapon_Base w=NULL, WeaponStateBase parent=NULL)
override void OnExit(WeaponEventBase e)
override bool SaveCurrentFSMState(ParamsWriteContext ctx)
void Error(string err)
Messagebox with error message.