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

fix includeDisabled flag in CBA_fnc_supportMonitor #1229

Merged
merged 1 commit into from
Sep 17, 2019

Conversation

commy2
Copy link
Contributor

@commy2 commy2 commented Sep 14, 2019

When merged this pull request will:

CBA_fnc_supportMonitor with includeDuplicates and includeDisabled is supposed to report all classes that do not support XEH, including those that have it explicitly disabled.

The XEH_DISABLED macro sets a flag that is for bwc still named SLX_XEH_DISABLED to 1. This flags only remaining purpose is to indicate that at least one parent class disabled XEH intentionally. Intentional disabling is for example done when it is clear that a lot of ancestor classes will be created by BI or addon makers that create their own EventHandler classes without inheritance and therefore will not support XEH. This avoids unnecessary logging of incompatible classes and the starting of the fallback loop. (Think of one RPT line for every flagpole retexture: they all get their texture by EventHandlers class init event that is not inherited, and BI and addon makers keep adding flagpoles using the same template).

The CBA_fnc_supportMonitor function before checking includeDuplicates and includeDisabled only considers classes that have EventHandlers\CBA_Extended_EventHandlers not defined.

The delete config command when used in XEH_DISABLED was very unreliable and caused inconsistency and unintended behavior. So when rewriting XEH to use the CBA_Extended_EventHandlers sub class of the EventHandlers class, I made it overwrite with an empty class instead of using delete: https://github.com/CBATeam/CBA_A3/blob/master/addons/main/script_macros_common.hpp#L1759

This means however that isClass still reports true. The real check should be if the class has content, which here is implemented as isText (X >> "init").

Example:

"WeaponHolder" in ([false, true, true] call CBA_fnc_supportMonitor);

before: false
after: true

@commy2 commy2 added the Bug Fix label Sep 14, 2019
@commy2 commy2 added this to the 3.13 milestone Sep 14, 2019
Copy link
Member

@jonpas jonpas left a comment

Choose a reason for hiding this comment

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

Great explanation!

@commy2 commy2 merged commit 61f376d into master Sep 17, 2019
@commy2 commy2 deleted the fix-supportMonitor-includeDisabled-flag branch September 17, 2019 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants