mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2026-02-20 07:02:56 +03:00
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:
@@ -225,6 +225,7 @@ if (_hit in USEC_MinorWounds) then {
|
||||
if (_unit == player) then {
|
||||
//Set player in combat
|
||||
_unit setVariable["startcombattimer", 1];
|
||||
_unit setVariable["inCombat", 1, true];
|
||||
};
|
||||
|
||||
//Shake the cam, frighten them!
|
||||
|
||||
@@ -65,6 +65,7 @@ player setVariable ["USEC_isCardiac",false,true];
|
||||
player setVariable ["medForceUpdate",true,true];
|
||||
player setVariable ["bloodTaken", false, true];
|
||||
player setVariable ["startcombattimer", 0]; //remove combat timer on death
|
||||
player setVariable ["inCombat", 0, true];
|
||||
r_player_unconscious = false;
|
||||
r_player_cardiac = false;
|
||||
_model = typeOf player;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
private ["_charID","_newmodel","_old","_updates","_humanity","_medical","_worldspace","_zombieKills","_headShots","_humanKills","_combattimeout","_banditKills","_fractures","_wpnType","_ismelee"];
|
||||
private ["_charID","_newmodel","_old","_updates","_humanity","_medical","_worldspace","_zombieKills","_headShots","_humanKills","_combattimeout","_inCombat","_banditKills","_fractures","_wpnType","_ismelee"];
|
||||
//_playerUID = _this select 0;
|
||||
_charID = _this select 1;
|
||||
_model = _this select 2;
|
||||
@@ -24,7 +24,7 @@ _humanKills = player getVariable ["humanKills",0];
|
||||
_banditKills = player getVariable ["banditKills",0];
|
||||
_achievements = player getVariable ["Achievements",[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];
|
||||
_combattimeout = player getVariable["combattimeout",0];
|
||||
|
||||
_inCombat = player getVariable["inCombat",0];
|
||||
_ConfirmedHumanKills = player getVariable ["ConfirmedHumanKills",0];
|
||||
_ConfirmedBanditKills = player getVariable ["ConfirmedBanditKills",0];
|
||||
_friendlies = player getVariable ["friendlies",[]];
|
||||
@@ -83,6 +83,7 @@ player setVariable ["characterID",_charID,true];
|
||||
player setVariable ["worldspace",_worldspace];
|
||||
player setVariable ["Achievements",_achievements];
|
||||
player setVariable ["combattimeout",_combattimeout,false];
|
||||
player setVariable ["inCombat", _inCombat, true];
|
||||
|
||||
player setVariable ["ConfirmedHumanKills",_ConfirmedHumanKills,true];
|
||||
player setVariable ["ConfirmedBanditKills",_ConfirmedBanditKills,true];
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -22,8 +22,10 @@ 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 (_distance <= 8) then {
|
||||
_unit setVariable["startcombattimer", 1];
|
||||
_unit setVariable["inCombat", 1, true];
|
||||
};
|
||||
|
||||
if (_inVehicle) exitWith {};
|
||||
|
||||
Reference in New Issue
Block a user