mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-15 21:29:59 +03:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user