Change inCombat to bool instead of number

When a variable is only going to be 0 or 1 it makes more sense to use a
bool.

Also avoided unnecessary network broadcasts of inCombat from e446603
This commit is contained in:
ebaydayz
2016-10-01 13:07:59 -04:00
parent 76273d06cd
commit 0a17804e36
11 changed files with 31 additions and 24 deletions

View File

@@ -34,7 +34,7 @@ while {(alive _projectile) && !(isNull _projectile) && (_callCount < 85)} do {
_isInCombat = _nearVehicle getVariable["startcombattimer",0];
if ((alive _nearVehicle) and _isInCombat == 0) then {
_nearVehicle setVariable["startcombattimer", 1];
_nearVehicle setVariable["inCombat", 1, true];
_nearVehicle setVariable["inCombat", true, true];
diag_log("Now in Combat (Player): " + name _unit);
};
};
@@ -44,7 +44,7 @@ while {(alive _projectile) && !(isNull _projectile) && (_callCount < 85)} do {
_isInCombat = _x getVariable["startcombattimer",0];
if (isPlayer _x and _isInCombat == 0 and alive _x) then {
_x setVariable["startcombattimer", 1];
_x setVariable["inCombat", 1, true];
_x setVariable["inCombat", true, true];
diag_log("Now in Combat (Crew): " + name _x);
};
} forEach (crew _nearVehicle);