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

replace usage of setCaptive with camouflageCoef trait #5864

Merged
merged 4 commits into from
Dec 7, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion addons/common/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,16 @@
[QGVAR(setCaptive), {
params ["_object", "_set"];
TRACE_2("setCaptive EH",_object,_set);
_object setCaptive (_set > 0);
private _visibility = _object getUnitTrait "camouflageCoef";
if (_set > 0) then {
if (_visibility != 0) then {
_object setVariable [QGVAR(oldVisibility), _visibility];
_object setUnitTrait ["camouflageCoef", 0];
};
} else {
_visibility = _unit getVariable [QGVAR(oldVisibility), _visibility];
_object setUnitTrait ["camouflageCoef", _visibility];
};
}] call CBA_fnc_addEventHandler;
[QGVAR(blockDamage), { //Name reversed from `allowDamage` because we want NOR logic
params ["_object", "_set"];
Expand Down