Explosives - Improve EOD unit equipment handling - #11435
Merged
PabstMirror merged 1 commit intoJul 26, 2026
Merged
Conversation
PabstMirror
reviewed
Jul 20, 2026
| params ["_unit"]; | ||
|
|
||
| private _config = configOf _unit; | ||
| if (getNumber (_config >> "canDeactivateMines") == 0) exitWith {}; |
Contributor
There was a problem hiding this comment.
Would using the trait be any better?
Suggested change
| if (getNumber (_config >> "canDeactivateMines") == 0) exitWith {}; | |
| if (!(_unit getUnitTrait "explosiveSpecialist")) exitWith {}; |
I'm not sure, but it might be more flexible
Contributor
Author
There was a problem hiding this comment.
I can't really decide what is better. getUnitTraitwould:
- handle non-EOD unit if defined as EOD - looks better, more support;
- ignore EOD unit if defined as non-EOD - looks worse?
Can handle both config and mission-defined:
Suggested change
| if (getNumber (_config >> "canDeactivateMines") == 0) exitWith {}; | |
| if ( | |
| getNumber (_config >> "canDeactivateMines") == 0 | |
| && { | |
| private _isEOD = _unit getUnitTrait "explosiveSpecialist"; | |
| isNil "_isEOD" || {!_isEOD} | |
| } | |
| ) exitWith {}; |
Anyway nil return handling is required in this case.
Contributor
There was a problem hiding this comment.
old way effectively just used config,
so I think we can just merge this as is and maybe change in the future if needed
PabstMirror
approved these changes
Jul 20, 2026
LinkIsGrim
approved these changes
Jul 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When merged this pull request will:
ToolKit(e.g.B_Patrol_Engineer_F).The config-based implementation is replaced with a scripted one. This allows ACE to support EOD units from other mods (e.g. CUP) without compat configs.
The script:
ToolKitonly if the unit is not an Engineer;ACE_ClackerandACE_DefusalKit).Can also do:
getUnitTraitinstead of the unit config to support mission-maker-defined EOD units. There is alsoace_common_fnc_isEOD, but if unit already hasACE_isEODvariable, maybe we should not handle its equipment.GVAR(EODItems)in the unit config).ToolKit).toLowerwhen checking item class names to handle possible case mistakes in configs.