307 {
308 if ( !
GetGame().IsDedicatedServer() )
309 {
310 Weapon_Base wpn = Weapon_Base.Cast(action_data.m_MainItem);
311 int muzzle_index = wpn.GetCurrentMuzzle();
312
313 AttachMagazineActionData am_action_data = AttachMagazineActionData.Cast(action_data);
314 am_action_data.m_oldMagazine = wpn.GetMagazine(muzzle_index);
315
316 ActionTarget newTarget =
new ActionTarget(action_data.m_Player.GetWeaponManager().GetPreparedMagazine(), null, -1, vector.Zero, -1);
317 action_data.m_Target = newTarget;
318
319 InventoryLocation new_il = new InventoryLocation;
320
321 if (!action_data.m_Player.GetWeaponManager().PrepareInventoryLocationForMagazineSwap(wpn, Magazine.Cast(action_data.m_Target.GetObject()), new_il))
322 {
323 return false;
324 }
325 am_action_data.m_ilOldMagazine = new_il;
326 }
327 return true;
328 }
class ActionTargets ActionTarget
proto native CGame GetGame()