17 if (!m_magazine || !
m_dst)
18 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" WeaponDetachingMag_Store, error - no magazine to load from (m_magazine=NULL)");
33 if (m_magazine.GetInventory().GetCurrentInventoryLocation(
il))
43 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" WeaponDetachingMag_Store, error - cannot store detached magazine!");
47 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" WeaponDetachingMag_Store, error - cannot get curr location");
59 if (!
ctx.Write(m_magazine))
61 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" WeaponDetachingMag_Store.SaveCurrentFSMState: cannot write m_magazine for weapon=" +
m_weapon);
67 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" WeaponDetachingMag_Store.SaveCurrentFSMState: cannot write m_st for weapon=" +
m_weapon);
75 if (!
super.LoadCurrentFSMState(
ctx, version))
78 if (!
ctx.Read(m_magazine))
80 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" WeaponDetachingMag_Store.LoadCurrentFSMState: cannot read m_magazine for weapon=" +
m_weapon);
85 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" WeaponDetachingMag_Store.LoadCurrentFSMState: cannot read m_dst for weapon=" +
m_weapon);
131 m_fsm.SetInitialState(
m_start);
138 WeaponEventDetachMagazine
de;
142 m_magazine =
e.m_magazine;
146 m_store.m_dst =
m_dst;
162 if (!
super.SaveCurrentFSMState(
ctx))
165 if (!
ctx.Write(m_magazine))
167 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" WeaponDetachingMag.SaveCurrentFSMState: cannot write m_magazine for weapon=" +
m_weapon);
173 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" WeaponDetachingMag.SaveCurrentFSMState: cannot write m_st for weapon=" +
m_weapon);
181 if (!
super.LoadCurrentFSMState(
ctx, version))
184 if (!
ctx.Read(m_magazine))
186 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" WeaponDetachingMag.LoadCurrentFSMState: cannot read m_magazine for weapon=" +
m_weapon);
191 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" WeaponDetachingMag.LoadCurrentFSMState: cannot read m_dst for weapon=" +
m_weapon);
void wpnDebugPrint(string s)
ref InventoryLocation m_dst
class WeaponGuardIsDestroyed extends WeaponGuardBase m_weapon
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
Super root of all classes in Enforce script.
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...
static bool IsWeaponLogEnable()
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
int m_actionType
action to be played
ref WeaponDetachingMag_Store m_store
void WeaponDetachingMag(Weapon_Base w=NULL, WeaponStateBase parent=NULL, WeaponActions action=WeaponActions.NONE, int actionType=-1)
override void OnEntry(WeaponEventBase e)
ref WeaponStateBase m_start
source of the cartridge
override bool LoadCurrentFSMState(ParamsReadContext ctx, int version)
ref InventoryLocation m_dst
magazine that will be detached
override void OnAbort(WeaponEventBase e)
ref MagazineHide_W4T m_hideM
override void OnExit(WeaponEventBase e)
override bool SaveCurrentFSMState(ParamsWriteContext ctx)
void Error(string err)
Messagebox with error message.
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.