Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Yardage - Fix broken display in 2.16 #9892

Merged
merged 1 commit into from
Apr 1, 2024
Merged
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
9 changes: 6 additions & 3 deletions addons/yardage450/functions/fnc_turnOn.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,15 @@ GVAR(active) = true;
[{
if (CBA_missionTime - GVAR(powerOnTime) > 30) exitWith {
GVAR(active) = false;
74210 cutText ["", "PLAIN"];
QUOTE(ADDON) cutText ["", "PLAIN"];
[_this select 1] call CBA_fnc_removePerFrameHandler;
};

if (currentWeapon ACE_player == "ACE_Yardage450" && cameraView == "GUNNER") then {
74210 cutRsc ["ACE_RscYardage450", "PLAIN", 1, false];
if (isNil {__dsp} || {isNull __dsp} || {ctrlIDD __dsp != -1}) then {
Copy link
Contributor

Choose a reason for hiding this comment

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

I was going to suggest isNil "__dsp", but realised that it's a macro...

All macros should be renamed to be upper case - I'll do it in another PR though.

TRACE_1("making display",__dsp);
QUOTE(ADDON) cutRsc ["ACE_RscYardage450", "PLAIN", 1, false];
};

__ctrlLaser ctrlShow GVAR(lasing);
if (GVAR(targetAcquired)) then {
Expand All @@ -51,7 +54,7 @@ GVAR(active) = true;
__ctrlMeters ctrlShow !GVAR(useYards);
__ctrlYards ctrlShow GVAR(useYards);
} else {
74210 cutText ["", "PLAIN"];
QUOTE(ADDON) cutText ["", "PLAIN"];
};

}, 0, []] call CBA_fnc_addPerFrameHandler;