-
Notifications
You must be signed in to change notification settings - Fork 737
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
Medical Damage - Improve custom wound handling #9310
Medical Damage - Improve custom wound handling #9310
Conversation
I'm not sure about this. I don't think many mods have modified wound handling yet, but I still don't think it's a safe change. |
I don't understand why it was designed this way in the first place: Why should the evaluation of all wound handlers be stopped if a single one fails? In fact, as it is now it's safer imo: It checks |
@pterolatypus your code. Thoughts? |
Appreciate I'm very late to this, been out of the game for a long time, but for the sake of information: If you're worried about someone's bad code causing a problem, you could make it only terminate when it gets exactly As to the bug fix: the current implementation does handle arbitrary expressions but I doubt anyone uses it as they're only actually called at PreInit, only the return value is stored. If you wrap it like that, the whole expression would get called on every wound event. I think that's fine, but you should probably just wrap it in every case so that it's consistent. Either way, your example should be more like:
because this entry is supposed to be an expression that returns a handler function. |
https://ace3.acemod.org/wiki/framework/medical-framework#44-wound-handler-function says that |
When merged this pull request will:
call _fnc
block if_fnc
in preInit and reparsing the config in postInit, when all functions should be compiled. This way slower versions are available during preInit, but after postInit thecall
wrap is removed to speed things up slightly.I'm not sure how well this new way can account for code in preInit specficially (see example below), but I'm not sure if this system was ever meant for handling code directly.
If a wound handler returns an invalid return, it will be ignored. However it will no longer stop checking other wound handlers; it will continue on until it has gone through all wound handlers.No longer the case.nil
.IMPORTANT
Component - Add|Fix|Improve|Change|Make|Remove {changes}
.