nwnxee / unified

Binaries available under the Releases tab on Github
https://nwnxee.github.io/unified
GNU General Public License v3.0
128 stars 91 forks source link

NWNX_Events: ON_COMBAT_EXIT does not hook (Must sub to ON_COMBAT_ENTER) #1701

Closed WilliamDraco closed 7 months ago

WilliamDraco commented 10 months ago

The InitOnFirstSubscribe is only setup for ON_COMBAT_ENTER. https://github.com/nwnxee/unified/blob/c1b6122b551b5046158a14c913a7bb5bf57abf9f/Plugins/Events/Events/CombatEvents.cpp#L66-L66 ON_COMBAT_EXIT uses the same hooked function as ENTER but does not hook it on its own. If someone only uses 'Exit' and never subscribes to 'Enter', it will never hook and therefore Exit does not fire.

Regex being more lenient would do it, but probably require too-much leniency. I'm not sure how to safely setup two subs for the same function in an "either/or" kind of way or I'd do it myself.

Daztek commented 10 months ago

NWNX_ON_COMBAT_(ENTER|EXIT)_.* should be fine, I think.