#endif
}
-void PM_check_race_movetime(void)
-{SELFPARAM();
-#ifdef SVQC
- self.race_movetime_frac += PHYS_INPUT_TIMELENGTH;
- float f = floor(self.race_movetime_frac);
- self.race_movetime_frac -= f;
- self.race_movetime_count += f;
- self.race_movetime = self.race_movetime_frac + self.race_movetime_count;
-#endif
-}
-
float PM_check_specialcommand(float buttons)
{SELFPARAM();
#ifdef SVQC
#endif
}
-#ifdef SVQC
-float speedaward_lastsent;
-float speedaward_lastupdate;
-#endif
-void PM_check_race(void)
-{SELFPARAM();
-#ifdef SVQC
- if(!(g_cts || g_race))
- return;
- if (vlen(self.velocity - self.velocity_z * '0 0 1') > speedaward_speed)
- {
- speedaward_speed = vlen(self.velocity - self.velocity_z * '0 0 1');
- speedaward_holder = self.netname;
- speedaward_uid = self.crypto_idfp;
- speedaward_lastupdate = time;
- }
- if (speedaward_speed > speedaward_lastsent && time - speedaward_lastupdate > 1)
- {
- string rr = (g_cts) ? CTS_RECORD : RACE_RECORD;
- race_send_speedaward(MSG_ALL);
- speedaward_lastsent = speedaward_speed;
- if (speedaward_speed > speedaward_alltimebest && speedaward_uid != "")
- {
- speedaward_alltimebest = speedaward_speed;
- speedaward_alltimebest_holder = speedaward_holder;
- speedaward_alltimebest_uid = speedaward_uid;
- db_put(ServerProgsDB, strcat(GetMapname(), rr, "speed/speed"), ftos(speedaward_alltimebest));
- db_put(ServerProgsDB, strcat(GetMapname(), rr, "speed/crypto_idfp"), speedaward_alltimebest_uid);
- race_send_speedaward_alltimebest(MSG_ALL);
- }
- }
-#endif
-}
-
void PM_check_vortex(void)
{SELFPARAM();
#ifdef SVQC
return;
#endif
- PM_check_race_movetime();
#ifdef SVQC
anticheat_physics();
#endif
if (IS_PLAYER(self))
#endif
{
-#ifdef SVQC
- if (self.race_penalty)
- if (time > self.race_penalty)
- self.race_penalty = 0;
-#endif
-
bool not_allowed_to_move = false;
-#ifdef SVQC
- if (self.race_penalty)
- not_allowed_to_move = true;
-#endif
#ifdef SVQC
if (time < game_starttime)
not_allowed_to_move = true;
else
PM_air(buttons_prev, maxspeed_mod);
-#ifdef SVQC
- if (!IS_OBSERVER(self))
- PM_check_race();
-#endif
PM_check_vortex();
:end
MUTATOR_HOOKFUNCTION(cts, PlayerPhysics)
{SELFPARAM();
+ self.race_movetime_frac += PHYS_INPUT_TIMELENGTH;
+ float f = floor(self.race_movetime_frac);
+ self.race_movetime_frac -= f;
+ self.race_movetime_count += f;
+ self.race_movetime = self.race_movetime_frac + self.race_movetime_count;
+
+#ifdef SVQC
+ if(IS_PLAYER(self))
+ {
+ if (self.race_penalty)
+ if (time > self.race_penalty)
+ self.race_penalty = 0;
+ if(self.race_penalty)
+ {
+ self.velocity = '0 0 0';
+ self.movetype = MOVETYPE_NONE;
+ self.disableclientprediction = 2;
+ }
+ }
+#endif
+
// force kbd movement for fairness
float wishspeed;
vector wishvel;
}
}
+ if (!IS_OBSERVER(self))
+ {
+ if (vlen(self.velocity - self.velocity_z * '0 0 1') > speedaward_speed)
+ {
+ speedaward_speed = vlen(self.velocity - self.velocity_z * '0 0 1');
+ speedaward_holder = self.netname;
+ speedaward_uid = self.crypto_idfp;
+ speedaward_lastupdate = time;
+ }
+ if (speedaward_speed > speedaward_lastsent && time - speedaward_lastupdate > 1)
+ {
+ string rr = CTS_RECORD;
+ race_send_speedaward(MSG_ALL);
+ speedaward_lastsent = speedaward_speed;
+ if (speedaward_speed > speedaward_alltimebest && speedaward_uid != "")
+ {
+ speedaward_alltimebest = speedaward_speed;
+ speedaward_alltimebest_holder = speedaward_holder;
+ speedaward_alltimebest_uid = speedaward_uid;
+ db_put(ServerProgsDB, strcat(GetMapname(), rr, "speed/speed"), ftos(speedaward_alltimebest));
+ db_put(ServerProgsDB, strcat(GetMapname(), rr, "speed/crypto_idfp"), speedaward_alltimebest_uid);
+ race_send_speedaward_alltimebest(MSG_ALL);
+ }
+ }
+ }
+
return false;
}
MUTATOR_HOOKFUNCTION(rc, PlayerPhysics)
{SELFPARAM();
+ self.race_movetime_frac += PHYS_INPUT_TIMELENGTH;
+ float f = floor(self.race_movetime_frac);
+ self.race_movetime_frac -= f;
+ self.race_movetime_count += f;
+ self.race_movetime = self.race_movetime_frac + self.race_movetime_count;
+
+#ifdef SVQC
+ if(IS_PLAYER(self))
+ {
+ if (self.race_penalty)
+ if (time > self.race_penalty)
+ self.race_penalty = 0;
+ if(self.race_penalty)
+ {
+ self.velocity = '0 0 0';
+ self.movetype = MOVETYPE_NONE;
+ self.disableclientprediction = 2;
+ }
+ }
+#endif
+
// force kbd movement for fairness
float wishspeed;
vector wishvel;
}
}
+ if (!IS_OBSERVER(self))
+ {
+ if (vlen(self.velocity - self.velocity_z * '0 0 1') > speedaward_speed)
+ {
+ speedaward_speed = vlen(self.velocity - self.velocity_z * '0 0 1');
+ speedaward_holder = self.netname;
+ speedaward_uid = self.crypto_idfp;
+ speedaward_lastupdate = time;
+ }
+ if (speedaward_speed > speedaward_lastsent && time - speedaward_lastupdate > 1)
+ {
+ string rr = RACE_RECORD;
+ race_send_speedaward(MSG_ALL);
+ speedaward_lastsent = speedaward_speed;
+ if (speedaward_speed > speedaward_alltimebest && speedaward_uid != "")
+ {
+ speedaward_alltimebest = speedaward_speed;
+ speedaward_alltimebest_holder = speedaward_holder;
+ speedaward_alltimebest_uid = speedaward_uid;
+ db_put(ServerProgsDB, strcat(GetMapname(), rr, "speed/speed"), ftos(speedaward_alltimebest));
+ db_put(ServerProgsDB, strcat(GetMapname(), rr, "speed/crypto_idfp"), speedaward_alltimebest_uid);
+ race_send_speedaward_alltimebest(MSG_ALL);
+ }
+ }
+ }
return false;
}
#ifndef RACE_H
#define RACE_H
+float speedaward_lastsent;
+float speedaward_lastupdate;
+
float race_spawns;
float race_highest_place_spawn; // number of places; a place higher gets spawned at 0
float race_lowest_place_spawn; // where to spawn in qualifying