WriteByte(MSG_BROADCAST, 0);
WriteByte(MSG_BROADCAST, 0);
}
- self.cnt = mod(self.cnt + 1, maxclients);
+ self.cnt = (self.cnt + 1) % maxclients;
}
void PingPLReport_Spawn()
{
for(i = 1; i < Map_Count; ++i)
{
float mapindex;
- mapindex = mod(i + Map_Current, Map_Count);
+ mapindex = (i + Map_Current) % Map_Count;
if(Map_Check(mapindex, pass))
return mapindex;
}
for(i = 0; i <= imax; ++i)
{
float mapindex;
- mapindex = mod(Map_Current + floor(random() * (Map_Count - 1) + 1), Map_Count); // any OTHER map
+ mapindex = (Map_Current + floor(random() * (Map_Count - 1) + 1)) % Map_Count; // any OTHER map
if(Map_Check(mapindex, 1))
return mapindex;
}
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.hit_time = time;
- 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.hit_time = time;
- 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);