-
Notifications
You must be signed in to change notification settings - Fork 739
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
Use getUnitTrait for medics, engineers and EOD #5246
Conversation
@@ -19,7 +19,7 @@ | |||
|
|||
params ["_unit", ["_medicN", 1]]; | |||
|
|||
private _class = _unit getVariable [QGVAR(medicClass), getNumber (configFile >> "CfgVehicles" >> typeOf _unit >> "attendant")]; | |||
private _class = _unit getVariable [QGVAR(medicClass), _unit getUnitTrait "medic"]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_class should be number, not bool
someone in public slack was talking about using config attendant =2
to set doctors
it's not the prettiest code, but something like this should support that
private _class = _unit getVariable QGVAR(medicClass);
if (isNil "_class") then {
if (_unit getUnitTrait "medic") then {
_class = 1 max getNumber (configFile >> "CfgVehicles" >> typeOf _unit >> "attendant");
} else{
_class = 0;
};
};
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we sure we want to support that since afaik the game itself treats the attendant
property as a boolean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be better to introduce an extra config property to support doctors that way (although, are doctors even relevant in the current medical code?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACE_common_fnc_getUnitTrait that will check all traits and "attendats"? Input of what you need to check. This will also help later if we decide to implement more types of medics, engineers and more.
Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that should be done in medical-rewrite, as we can afford to change things there that would otherwise be backwards-incompatible.
I didn't add the code for |
Could replace the
|
When merged this pull request will:
getUnitTrait
command which makes them compatible with use ofsetUnitTrait
and not purely checking the config