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

Common - Fix calling getVar on null object in canInteractWith #8532

Merged
merged 2 commits into from
Oct 16, 2021

Conversation

PabstMirror
Copy link
Contributor

@PabstMirror PabstMirror commented Oct 16, 2021

Prime a grenade in adv_tossing and it spams rpt with

getVariable called on null object
 ➥ Context: 	[] L49 (z\ace\addons\advanced_throwing\functions\fnc_prepare.sqf)
	[] L18 (z\ace\addons\advanced_throwing\functions\fnc_drawThrowable.sqf)
	[] L18 (z\ace\addons\advanced_throwing\functions\fnc_drawThrowable.sqf)
	[] L32 (z\ace\addons\advanced_throwing\functions\fnc_canPrepare.sqf)
	[] L33 (z\ace\addons\advanced_throwing\functions\fnc_canPrepare.sqf)
	[] L24 (z\ace\addons\common\functions\fnc_canInteractWith.sqf)

there is a call with null target

{[_unit, objNull, [...]] call EFUNC(common,canInteractWith)}

and in 2.06 calling getVar on a null throws rpt warning (but no popup even with showscript debug)

edit: this is a profiling branch thing

  • Added: Debug log message with context for when a script tries to getVariable on objNull/grpNull

@PabstMirror PabstMirror added kind/bug-fix Release Notes: **FIXED:** impact/trivial labels Oct 16, 2021
@PabstMirror PabstMirror added this to the 3.14.0 milestone Oct 16, 2021
@PabstMirror PabstMirror modified the milestones: 3.14.0, 3.14.1 Oct 16, 2021
@PabstMirror PabstMirror modified the milestones: 3.14.1, 3.14.0 Oct 16, 2021
@PabstMirror PabstMirror merged commit a0e9f60 into master Oct 16, 2021
@PabstMirror PabstMirror deleted the canInteractGetVarSpam branch October 16, 2021 22:15
@dedmen
Copy link
Contributor

dedmen commented Oct 19, 2021

and in 2.06 calling getVar on a null throws rpt warning

Only with -debug mode enabled, and it got disabled when default value is provided (which you have) or unscheduled (which you have too)

TLDR this RPT warning won't happen for you there.

So both changes harm performance (eeeever so slightly) and are not needed.

@veteran29
Copy link
Member

and in 2.06 calling getVar on a null throws rpt warning

Only with -debug mode enabled, and it got disabled when default value is provided (which you have) or unscheduled (which you have too)

TLDR this RPT warning won't happen for you there.

So both changes harm performance (eeeever so slightly) and are not needed.

@PabstMirror revert? :D

@PabstMirror
Copy link
Contributor Author

yeah

PabstMirror added a commit that referenced this pull request Oct 19, 2021
@PabstMirror PabstMirror modified the milestones: 3.14.0, Ongoing Oct 19, 2021
@PabstMirror PabstMirror added ignore-changelog Release Notes: Excluded and removed kind/bug-fix Release Notes: **FIXED:** impact/trivial labels Oct 19, 2021
@PabstMirror PabstMirror modified the milestones: Ongoing, 3.14.0 Oct 19, 2021
PabstMirror added a commit that referenced this pull request Oct 19, 2021
AndreasBrostrom pushed a commit to AndreasBrostrom/ACE3 that referenced this pull request Dec 3, 2021
…od#8532)

* Common - Fix calling getVar on null object in `canInteractWith`

* why was this added dedman?
AndreasBrostrom pushed a commit to AndreasBrostrom/ACE3 that referenced this pull request Dec 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ignore-changelog Release Notes: Excluded
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants