}
}
-void ClientCommand_ready(entity caller, int request) // todo: anti-spam for toggling readyness
+void ClientCommand_ready(entity caller, int request)
{
switch (request)
{
case CMD_REQUEST_COMMAND:
{
- if (IS_CLIENT(caller))
+ if (IS_CLIENT(caller) && caller.last_ready < time - 3) // anti-spam
{
if (warmup_stage || sv_ready_restart || g_race_qualifying == 2)
{
if(IS_PLAYER(caller) || caller.caplayer == 1)
bprint("\{1}", playername(caller, false), "^2 is ready\n");
}
+
+ caller.last_ready = time;
// cannot reset the game while a timeout is active!
if (!timeout_status) ReadyCount();
float readyrestart_happened; // keeps track of whether a restart has already happened
float restart_mapalreadyrestarted; // bool, indicates whether reset_map() was already executed
.float ready; // flag for if a player is ready
+.float last_ready; // z411 time of the last readyup for anti-spam
.int team_saved; // team number to restore upon map reset
.void(entity this) reset; // if set, an entity is reset using this
.void(entity this) reset2; // if set, an entity is reset using this (after calling ALL the reset functions for other entities)
void Item_RespawnCountdown(entity this)
{
+ if(game_timeout) { this.nextthink = time + 1; return; }
+
if(this.item_respawncounter >= ITEM_RESPAWN_TICKS)
{
if(this.waypointsprite_attached)
else
{
this.nextthink = time + 1;
- this.item_respawncounter += 1;
+ this.item_respawncounter = floor((time - timeout_total_time) - (this.scheduledrespawntime - ITEM_RESPAWN_TICKS)) + 1;
+ //this.item_respawncounter += 1;
+ //LOG_INFOF("Respawncounter: %d", this.item_respawncounter);
+ if(this.item_respawncounter < 1) return;
+
if(this.item_respawncounter == 1)
{
do {
if ((Item_ItemsTime_Allow(e.itemdef) || (STAT(WEAPONS, e) & WEPSET_SUPERWEAPONS) || MUTATOR_CALLHOOK(Item_ScheduleRespawn, e, t)) && (t - ITEM_RESPAWN_TICKS) > 0)
{
setthink(e, Item_RespawnCountdown);
- e.nextthink = time + max(0, t - ITEM_RESPAWN_TICKS);
- e.scheduledrespawntime = e.nextthink + ITEM_RESPAWN_TICKS;
+ //e.nextthink = time - timeout_total_time + max(0, t - ITEM_RESPAWN_TICKS);
+ //e.scheduledrespawntime = e.nextthink + ITEM_RESPAWN_TICKS;
+ e.nextthink = time;
+ e.scheduledrespawntime = time - timeout_total_time + t;
e.item_respawncounter = 0;
+
if(Item_ItemsTime_Allow(e.itemdef) || (STAT(WEAPONS, e) & WEPSET_SUPERWEAPONS))
{
t = Item_ItemsTime_UpdateTime(e, e.scheduledrespawntime);