Commit ef699c7a authored by Mario's avatar Mario

Merge branch 'TimePath/issues/1428' into 'master'

Repeated hitsound fix

Fixes #1428

See merge request !64
parents 3e0fddda 4a82dec0
This diff is collapsed.
......@@ -56,21 +56,21 @@ const float STAT_VORTEX_CHARGE = 50;
const float STAT_LAST_PICKUP = 51;
const float STAT_HUD = 52;
const float STAT_VORTEX_CHARGEPOOL = 53;
const float STAT_DAMAGE_DEALT_TOTAL = 54;
const float STAT_TYPEHIT_TIME = 55;
const float STAT_LAYED_MINES = 56;
const float STAT_HAGAR_LOAD = 57;
const float STAT_SWITCHINGWEAPON = 58;
const float STAT_SUPERWEAPONS_FINISHED = 59;
const float STAT_VEHICLESTAT_HEALTH = 60;
const float STAT_VEHICLESTAT_SHIELD = 61;
const float STAT_VEHICLESTAT_ENERGY = 62;
const float STAT_VEHICLESTAT_AMMO1 = 63;
const float STAT_VEHICLESTAT_RELOAD1 = 64;
const float STAT_VEHICLESTAT_AMMO2 = 65;
const float STAT_VEHICLESTAT_RELOAD2 = 66;
const float STAT_VEHICLESTAT_W2MODE = 67;
// 68 empty?
const float STAT_HIT_TIME = 54;
const float STAT_DAMAGE_DEALT_TOTAL = 55;
const float STAT_TYPEHIT_TIME = 56;
const float STAT_LAYED_MINES = 57;
const float STAT_HAGAR_LOAD = 58;
const float STAT_SWITCHINGWEAPON = 59;
const float STAT_SUPERWEAPONS_FINISHED = 60;
const float STAT_VEHICLESTAT_HEALTH = 61;
const float STAT_VEHICLESTAT_SHIELD = 62;
const float STAT_VEHICLESTAT_ENERGY = 63;
const float STAT_VEHICLESTAT_AMMO1 = 64;
const float STAT_VEHICLESTAT_RELOAD1 = 65;
const float STAT_VEHICLESTAT_AMMO2 = 66;
const float STAT_VEHICLESTAT_RELOAD2 = 67;
const float STAT_VEHICLESTAT_W2MODE = 68;
const float STAT_NADE_TIMER = 69;
const float STAT_SECRETS_TOTAL = 70;
const float STAT_SECRETS_FOUND = 71;
......
......@@ -451,3 +451,6 @@ vector bezier_quadratic_getpoint(vector a, vector p, vector b, float t);
vector bezier_quadratic_getderivative(vector a, vector p, vector b, float t);
#define APPEND_TO_STRING(list,sep,add) ((list) = (((list) != "") ? strcat(list, sep, add) : (add)))
// Returns the correct difference between two always increasing numbers
#define COMPARE_INCREASING(to,from) (to < from ? from + to + 2 : to - from)
\ No newline at end of file
......@@ -755,6 +755,7 @@ void spawnfunc_worldspawn (void)
addstat(STAT_WEAPON_CLIPLOAD, AS_INT, clip_load);
addstat(STAT_WEAPON_CLIPSIZE, AS_INT, clip_size);
addstat(STAT_LAST_PICKUP, AS_FLOAT, last_pickup);
addstat(STAT_HIT_TIME, AS_FLOAT, hit_time);
addstat(STAT_DAMAGE_DEALT_TOTAL, AS_INT, damage_dealt_total);
addstat(STAT_TYPEHIT_TIME, AS_FLOAT, typehit_time);
addstat(STAT_LAYED_MINES, AS_INT, minelayer_mines);
......@@ -2203,21 +2204,13 @@ void EndFrame()
float altime;
FOR_EACH_REALCLIENT(self)
{
self.damage_dealt_total = 0;
if(IS_SPEC(self))
{
if(self.enemy.typehitsound)
self.typehit_time = time;
else if(self.enemy.damage_dealt)
self.damage_dealt_total = ceil(self.enemy.damage_dealt);
}
else
entity e = IS_SPEC(self) ? self.enemy : self;
if(e.typehitsound)
self.typehit_time = time;
else if(e.damage_dealt)
{
if(self.typehitsound)
self.typehit_time = time;
else if(self.damage_dealt)
self.damage_dealt_total = ceil(self.damage_dealt);
self.hit_time = time;
self.damage_dealt_total += ceil(e.damage_dealt);
}
}
altime = time + frametime * (1 + autocvar_g_antilag_nudge);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment