]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/server/race.qh
Store record type into a global to avoid some gamemode checks
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / race.qh
1 #pragma once
2
3 bool autocvar_g_allow_checkpoints;
4
5 float race_teams;
6
7 // default to RACE_RECORD, can be overwritten by gamemodes
8 string record_type = RACE_RECORD;
9
10 // scores
11 const float ST_RACE_LAPS = 1;
12
13 int autocvar_g_cts_send_rankings_cnt = 15;
14
15 bool g_race_qualifying;
16
17 float speedaward_lastsent;
18 float speedaward_lastupdate;
19
20 float race_spawns;
21 float race_highest_place_spawn; // number of places; a place higher gets spawned at 0
22 float race_lowest_place_spawn; // where to spawn in qualifying
23 float race_fraglimit;
24 float race_leadlimit;
25 float race_timelimit;
26 .float race_place;
27 .float race_started;
28 .float race_completed;
29 .float race_laptime;
30 float race_completing;
31
32 .float race_movetime; // for reading
33 .float race_movetime_frac; // fractional accumulator for higher accuracy (helper for writing)
34 .float race_movetime_count; // integer accumulator
35
36 .float race_respawn_checkpoint;
37 .entity race_respawn_spotref; // try THIS spawn in case you respawn
38
39 // definitions for functions used outside race.qc
40 void write_recordmarker(entity pl, float tstart, float dt);
41
42 float race_PreviousCheckpoint(float f);
43 float race_NextCheckpoint(float f);
44 void race_AbandonRaceCheck(entity p);
45 void race_ImposePenaltyTime(entity pl, float penalty, string reason);
46 void race_StartCompleting();
47 float race_GetFractionalLapCount(entity e);
48 float race_readTime(string map, float pos);
49 string race_readUID(string map, float pos);
50 string race_readName(string map, float pos);
51 void race_checkAndWriteName(entity player);
52 void race_ClearRecords();
53 void race_SendNextCheckpoint(entity e, float spec);
54 void race_PreparePlayer(entity this);
55 void race_send_recordtime(float msg);
56 void race_send_speedaward(float msg);
57 void race_setTime(string map, float t, string myuid, string mynetname, entity e, bool showmessage);
58
59 float speedaward_speed;
60 string speedaward_holder;
61 string speedaward_uid;
62
63 float speedaward_alltimebest;
64 string speedaward_alltimebest_holder;
65 string speedaward_alltimebest_uid;
66
67 void race_send_speedaward(float msg);
68
69 void race_send_speedaward_alltimebest(float msg);
70
71 void race_send_rankings_cnt(float msg);
72
73 void race_SendRankings(float pos, float prevpos, float del, float msg);
74
75 void race_RetractPlayer(entity this);
76
77 void race_InitSpectator();
78
79 string uid2name(string myuid);
80
81 spawnfunc(target_checkpoint);