17 if (!m_magazine || !
m_dst)
19 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" WeaponDetachingMag_Store, error - no magazine to load from (m_magazine=NULL)");
35 if (m_magazine.GetInventory().GetCurrentInventoryLocation(il))
45 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" WeaponDetachingMag_Store, error - cannot store detached magazine!");
50 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" WeaponDetachingMag_Store, error - cannot get curr location");
60 if (!super.SaveCurrentFSMState(ctx))
63 if (!ctx.Write(m_magazine))
65 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" WeaponDetachingMag_Store.SaveCurrentFSMState: cannot write m_magazine for weapon=" +
m_weapon);
71 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" WeaponDetachingMag_Store.SaveCurrentFSMState: cannot write m_st for weapon=" +
m_weapon);
79 if (!super.LoadCurrentFSMState(ctx, version))
82 if (!ctx.Read(m_magazine))
84 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" WeaponDetachingMag_Store.LoadCurrentFSMState: cannot read m_magazine for weapon=" +
m_weapon);
89 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" WeaponDetachingMag_Store.LoadCurrentFSMState: cannot read m_dst for weapon=" +
m_weapon);
109 ref WeaponDetachingMag_Store m_store;
110 ref MagazineHide_W4T m_hideM;
115 m_actionType = actionType;
119 m_store =
new WeaponDetachingMag_Store(
m_weapon,
this);
120 m_hideM =
new MagazineHide_W4T(
m_weapon,
this);
135 m_fsm.SetInitialState(
m_start);
142 WeaponEventDetachMagazine de;
143 if (
Class.CastTo(de, e))
146 m_magazine = e.m_magazine;
149 m_store.m_magazine = m_magazine;
150 m_store.m_dst =
m_dst;
166 if (!super.SaveCurrentFSMState(ctx))
169 if (!ctx.Write(m_magazine))
171 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" WeaponDetachingMag.SaveCurrentFSMState: cannot write m_magazine for weapon=" +
m_weapon);
177 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" WeaponDetachingMag.SaveCurrentFSMState: cannot write m_st for weapon=" +
m_weapon);
185 if (!super.LoadCurrentFSMState(ctx, version))
188 if (!ctx.Read(m_magazine))
190 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" WeaponDetachingMag.LoadCurrentFSMState: cannot read m_magazine for weapon=" +
m_weapon);
195 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" WeaponDetachingMag.LoadCurrentFSMState: cannot read m_dst for weapon=" +
m_weapon);