3 Magazine m_magazinePile;
18 m_CallbackClass = ActionEmptyMagazineCB;
21 m_Text =
"#empty_magazine";
26 if ( super.SetupAction( player, target, item, action_data, extra_data))
29 emActionData.m_magazinePile = NULL;
41 override void CreateConditionComponents()
47 override bool HasProneException()
55 return ( item &&
Class.CastTo(mag, item) && mag.GetAmmoCount() > 0 );
58 override bool ActionConditionContinue(
ActionData action_data )
60 return CanEmpty(action_data.m_MainItem);
66 return CanEmpty(item);
69 override bool HasTarget()
74 override void OnExecuteServer(
ActionData action_data )
79 if (!
Class.CastTo(mag, action_data.m_MainItem))
123 if ( !mag.ServerAcquireCartridge(dmg,ammoType) )
126 mag.ApplyManipulationDamage();
128 string magazineTypeName;
129 GetGame().ConfigGetText(
"CfgAmmo " + ammoType +
" spawnPileType" , magazineTypeName);
131 if ( !
DayZPlayerUtils.HandleStoreCartridge(action_data.m_Player, NULL, -1, dmg, ammoType, magazineTypeName,
false) )
135 if ( !emActionData.m_magazinePile )
137 piles = MiscGameplayFunctions.CreateMagazinePilesFromBullet(ammoType,action_data.m_Player.GetPosition(),1,dmg);
138 if ( piles.Count() > 0 )
139 emActionData.m_magazinePile = piles.Get(0);
143 if ( emActionData.m_magazinePile.GetAmmoMax() > emActionData.m_magazinePile.GetAmmoCount() && (
vector.DistanceSq(action_data.m_Player.GetPosition(), emActionData.m_magazinePile.GetPosition()) < (
UAMaxDistances.DEFAULT *
UAMaxDistances.DEFAULT) ) )
145 emActionData.m_magazinePile.ServerStoreCartridge(dmg,ammoType);
149 piles = MiscGameplayFunctions.CreateMagazinePilesFromBullet(ammoType, action_data.m_Player.GetPosition(), 1, dmg);
150 if ( piles.Count() > 0 )
151 emActionData.m_magazinePile = piles.Get(0);