Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion addons/javelin/XEH_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ DFUNC(disableFire) = {

if (_firedEH < 0 && {difficulty > 0}) then {
_firedEH = [ACE_player, "DefaultAction", {true}, {
private _canFire = (_this select 1) getVariable ["ace_missileguidance_target", nil];
private _canFire = (_this select 1) getVariable [QEGVAR(missileguidance,target), nil];
if (!isNil "_canFire") exitWith { false };
true
}] call EFUNC(common,addActionEventHandler);
Expand Down
5 changes: 3 additions & 2 deletions addons/javelin/functions/fnc_onOpticDraw.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ private _weaponEnabledConfig = _weaponConfig >> QGVAR(enabled);
private _ammoConfig = [];

// Only consider weapons with explicit enable configs (inheritance not allowed)
private _ammoType = getText (configFile >> "CfgMagazines" >> _currentMagazine >> "ammo");
if (_weaponConfig == inheritsFrom _weaponEnabledConfig) then {
private _ammoType = getText (configFile >> "CfgMagazines" >> _currentMagazine >> "ammo");
_ammoConfig = "configName _x == 'ace_missileguidance'" configClasses (configFile >> "CfgAmmo" >> _ammoType);
} else {
// If weapon enable is inherited, mark as invalid
Expand All @@ -52,7 +52,8 @@ if (_weaponConfig == inheritsFrom _weaponEnabledConfig) then {
// Check if loaded and javelin enabled for wepaon and missile guidance enabled for loaded ammo
if ((_ammoCount == 0) || // No ammo loaded
{(getNumber _weaponEnabledConfig) != 1} || // Not enabled for weapon
{_ammoConfig isEqualTo []} || {(getNumber ((_ammoConfig select 0) >> "enabled")) != 1} // Not enabled for ammo
{_ammoConfig isEqualTo []} || {(getNumber ((_ammoConfig select 0) >> "enabled")) != 1} || // Not enabled for ammo
{ getNumber (configFile >> "CfgAmmo" >> _ammoType >> QEGVAR(missileguidance,allowDumbFire)) == 1 } // Allows firing without lock

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{ getNumber (configFile >> "CfgAmmo" >> _ammoType >> QEGVAR(missileguidance,allowDumbFire)) == 1 } // Allows firing without lock
{(getNumber ((_ammoConfig select 0) >> "allowDumbFire")) == 1} // Allows firing without lock

this would be on the mg class instead of the ammo?
CfgAmmo -> ammo -> ace_missileguidance -> allowDumbfire
instead of
CfgAmmo -> ammo -> ace_missileguidance_allowDumbfire

) exitWith {

__JavelinIGUITargeting ctrlShow false;
Expand Down