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

Yardage - Fix broken display in 2.16 #9892

merged 1 commit into from
Apr 1, 2024

Conversation

PabstMirror
Copy link
Contributor

Fix #9891
Before the code would spam 74210 cutText ["", "PLAIN"]; each frame
which should be valid, but it does create a new display each time
for some reason the onUnload of the last display would run after the onLoad of the new display
(apparently fixed in profiling branch)

Normal 2.16.151618:
[ACE] (yardage450) TRACE: 2198 before cut: (uiNamespace getVariable "ACE_RscYardage450")=any z\ace\addons\yardage450\functions\fnc_turnOn.sqf:46
"""onLoad"""
[ACE] (yardage450) TRACE: 2198 after cut: (uiNamespace getVariable "ACE_RscYardage450")=Display #-1 z\ace\addons\yardage450\functions\fnc_turnOn.sqf:50

[ACE] (yardage450) TRACE: 2226 before cut: (uiNamespace getVariable "ACE_RscYardage450")=Display #-1 z\ace\addons\yardage450\functions\fnc_turnOn.sqf:46
"""onLoad"""
"""onUnload""" // notice the order, this does `ACE_RscYardage450 = displayNull;`
[ACE] (yardage450) TRACE: 2226 after cut: (uiNamespace getVariable "ACE_RscYardage450")=No display z\ace\addons\yardage450\functions\fnc_turnOn.sqf:50
Profiling 2.16.151648:
[ACE] (yardage450) TRACE: 1325 before cut: (uiNamespace getVariable "ACE_RscYardage450")=any z\ace\addons\yardage450\functions\fnc_turnOn.sqf:46
"""onLoad"""
[ACE] (yardage450) TRACE: 1325 after cut: (uiNamespace getVariable "ACE_RscYardage450")=Display #-1 z\ace\addons\yardage450\functions\fnc_turnOn.sqf:50

[ACE] (yardage450) TRACE: 1353 before cut: (uiNamespace getVariable "ACE_RscYardage450")=Display #-1 z\ace\addons\yardage450\functions\fnc_turnOn.sqf:46
"""onUnload"""
"""onLoad"""
[ACE] (yardage450) TRACE: 1353 after cut: (uiNamespace getVariable "ACE_RscYardage450")=Display #-1 z\ace\addons\yardage450\functions\fnc_turnOn.sqf:50

@PabstMirror PabstMirror added the kind/bug-fix Release Notes: **FIXED:** label Apr 1, 2024
[_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.

@jonpas jonpas added this to the 3.17.0 milestone Apr 1, 2024
@jonpas jonpas merged commit 0365565 into master Apr 1, 2024
5 checks passed
@jonpas jonpas deleted the fixMeterage branch April 1, 2024 11:28
@jonpas jonpas added the 2.16 label Apr 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug-fix Release Notes: **FIXED:**
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Yardage 450 - Unable to Range
4 participants