Skip to content

Commit

Permalink
Fix flares not working after rearm
Browse files Browse the repository at this point in the history
When you exhaust all the flares and rearm them, they will rearm
correctly but the flares are unusable, this will remove the flare turret
THEN add the ammo THEN readd the flare turret.

Thanks to zambas for the heads up
  • Loading branch information
oiad committed Apr 24, 2020
1 parent 1c91875 commit b349297
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,13 @@ if (_enoughMoney) then {
_magazines = getArray (configFile >> "CfgWeapons" >> _weaponType >> "magazines");
_ammo = _magazines select 0;

for "_i" from 1 to _magazineCount do {_vehicle addMagazineTurret [_ammo,_turret];};
if (_weaponType == "CMFlareLauncher") then {
_vehicle removeWeaponTurret ["CMFlareLauncher",_turret];
for "_i" from 1 to _magazineCount do {_vehicle addMagazineTurret [_ammo,_turret];};
_vehicle addWeaponTurret ["CMFlareLauncher",_turret];
} else {
for "_i" from 1 to _magazineCount do {_vehicle addMagazineTurret [_ammo,_turret];};
};

[format[localize "STR_CL_SP_REARMED",_weaponName,_name],1] call dayz_rollingMessages;
};
Expand Down

0 comments on commit b349297

Please sign in to comment.