3 Magazine m_newMagazine;
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);
31 lhand.SetAttachment(e.m_player, m_newMagazine,
InventorySlots.LEFTHAND);
34 if (
LogManager.IsWeaponLogEnable()) {
wpnDebugPrint(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" RemoveNewMagazineFromInventory, ok - new magazine removed from inv (inv->LHand)"); }
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)");
65 if (!super.SaveCurrentFSMState(ctx))
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);
121 ref WeaponChamberFromAttMag_W4T
m_chamber;
122 ref WeaponCharging_CK m_onCK;
128 m_actionType = actionType;
135 m_onCK =
new WeaponCharging_CK(
m_weapon,
this);
160 m_fsm.SetInitialState(
m_start);
167 Magazine mag = e.m_magazine;
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;
193 Magazine mag = Magazine.Cast(leftHandItem);
197 e.m_player.GetInventory().ClearInventoryReservationEx( mag ,
null );
201 if(!il || !il.IsValid())
205 if (
LogManager.IsWeaponLogEnable()) {
wpnDebugPrint(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" WeaponAttachMagazine, ok - no inventory space for old magazine - dropped to ground"); }
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");