mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2026-02-04 15:22:53 +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:
@@ -22,10 +22,14 @@ private ["_handled"];
|
||||
// Both the firer and those nearby (<=8m) go into "combat" to prevent ALT-F4
|
||||
//diag_log ("DEBUG: AMMO TYPE: " +str(_ammo));
|
||||
_firer setVariable["startcombattimer", 1];
|
||||
_firer setVariable["inCombat", 1, true];
|
||||
if (_firer getVariable["inCombat",false]) then {
|
||||
_firer setVariable["inCombat",true,true];
|
||||
};
|
||||
if (_distance <= 8) then {
|
||||
_unit setVariable["startcombattimer", 1];
|
||||
_unit setVariable["inCombat", 1, true];
|
||||
if (_unit getVariable["inCombat",false]) then {
|
||||
_unit setVariable["inCombat",true,true];
|
||||
};
|
||||
};
|
||||
|
||||
if (_inVehicle) exitWith {};
|
||||
|
||||
Reference in New Issue
Block a user