Skip to content

Commit 1f1ad2d

Browse files
authored
Missile Guidance - remove needed config entry on mclos weapons (acemod#10751)
1 parent 646ea4c commit 1f1ad2d

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

addons/missileguidance/XEH_preInit.sqf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ for "_i" from 0 to MAX_PB_MODES do {
2626
GVAR(gps_mode) = "pb";
2727
GVAR(gps_weapons) = createHashMap;
2828

29+
GVAR(mclos_weapons) = createHashMap;
30+
2931
GVAR(debug_enableMissileCamera) = false;
3032
GVAR(debug_drawGuidanceInfo) = false;
3133

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
class MissileLauncher;
22
class GVAR(mock_w_Malyutka): MissileLauncher {
33
displayName = "Test Malyutka";
4-
GVAR(hasMCLOSControl) = 1;
54
magazineReloadTime=1;
65
magazines[] = { QGVAR(mock_m_Malyutka) };
76
};

addons/missileguidance/functions/fnc_MCLOS_buttonPressed.sqf

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,17 @@ if (_player == _shooter) exitWith {};
2323
private _turret = _shooter unitTurret _player;
2424

2525
if (((_shooter weaponsTurret _turret) findIf {
26-
(getNumber (configFile >> "CfgWeapons" >> _x >> QGVAR(hasMCLOSControl))) == 1
26+
private _weapon = _x;
27+
GVAR(mclos_weapons) getOrDefaultCall [_weapon, {
28+
((compatibleMagazines _weapon) findIf {
29+
private _mag = _x;
30+
private _ammo = getText (configFile >> "CfgMagazines" >> _mag >> "ammo");
31+
("MCLOS" in getArray (configFile >> "CfgAmmo" >> _ammo >> QUOTE(ADDON) >> "seekerTypes"))
32+
}) != -1}, true]
2733
}) == -1) exitWith { false };
2834

2935

30-
playSound "ACE_Sound_Click_20db";
36+
playSound "ACE_Sound_Click_10db";
3137

3238
private _currentDirection = _shooter getVariable [QGVAR(MCLOS_direction), [0, 0, 0]];
3339
// Send data across network for handling non-local projectiles

0 commit comments

Comments
 (0)