Fix combat logging

In the initialize section of the fsm r_player_unconscious and
r_player_timeout return their default values (false and 0). Also, the
Vanilla server-side combat check doesn't appear to work, or it doesn't
work with the antihack disabled (I haven't tested with it enabled).

New variable inCombat is set more quickly than the combatTimeout
variable
This commit is contained in:
icomrade
2016-07-26 20:51:10 -04:00
parent a72498671d
commit e446603ea2
9 changed files with 45 additions and 26 deletions

View File

@@ -34,6 +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];
diag_log("Now in Combat (Player): " + name _unit);
};
};
@@ -43,6 +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];
diag_log("Now in Combat (Crew): " + name _x);
};
} forEach (crew _nearVehicle);