if(newspectatee_status != spectatee_status)
{
- // clear race stuff
- race_laptime = 0;
- race_checkpointtime = 0;
hud_dynamic_shake_factor = -1;
spectatee_status_changed_time = time;
}
CS(this).pressedkeys = 0;
STAT(PRESSED_KEYS, this) = 0;
}
+
ClientData_Touch(this);
- if (g_race || g_cts) race_InitSpectator();
+
+ // init or clear race data
+ if ((g_race || g_cts) && g_race_qualifying && IS_REAL_CLIENT(this))
+ {
+ msg_entity = this;
+
+ if (this.enemy && this.enemy.race_laptime)
+ {
+ // init
+ race_SendNextCheckpoint(this.enemy, 1);
+ }
+ else
+ {
+ // send reset to this spectator
+ WriteHeader(MSG_ONE, TE_CSQC_RACE);
+ WriteByte(MSG_ONE, RACE_NET_CHECKPOINT_CLEAR);
+ }
+ }
}
}
IntrusiveList g_race_targets;
IntrusiveList g_racecheckpoints;
-void race_InitSpectator()
-{
- if(g_race_qualifying)
- if(msg_entity.enemy.race_laptime)
- race_SendNextCheckpoint(msg_entity.enemy, 1);
-}
-
float race_readTime(string map, float pos)
{
return stof(db_get(ServerProgsDB, strcat(map, record_type, "time", ftos(pos))));
void race_RetractPlayer(entity this);
-void race_InitSpectator();
-
string uid2name(string myuid);
spawnfunc(target_checkpoint);