Xonotic
main.qh
Go to the documentation of this file.
1 #pragma once
2 
3 #include <common/constants.qh>
4 #include <common/weapons/_all.qh>
5 
9 // float autocvar_cl_spawn_point_model;
20 bool autocvar_cl_race_cptimes_onlyself; // TODO: move to race gamemode
22 
23 // Map coordinate base calculations need these
26 // Minimap
27 string minimapname;
28 
29 bool postinit;
31 // temporary hack
32 #define ISGAMETYPE(NAME) (gametype == MAPINFO_TYPE_##NAME)
33 
34 float FONT_USER = 8;
35 
36 
37 void PostInit();
38 
39 void Ent_Remove(entity this);
40 
41 void Gamemode_Init();
42 
45 float team_count; // real teams
46 
47 void AuditLists();
48 
49 float RegisterPlayer(entity player);
50 
51 void RemovePlayer(entity player);
52 
53 void MoveToLast(entity e);
54 
55 float RegisterTeam(entity Team);
56 
57 void RemoveTeam(entity Team);
58 
59 entity GetTeam(int Team, bool add);
60 
61 bool SetTeam(entity pl, int Team);
62 
64 
67 string grecordholder[RANKINGS_CNT];
68 float grecordtime[RANKINGS_CNT];
69 
70 entity playerslots[255]; // 255 is engine limit on maxclients
71 entity teamslots[17]; // 17 teams (including "spectator team")
72 .bool gotscores;
73 .entity owner;
74 .bool ready;
75 .bool eliminated;
76 
82 {
83  g_drawables = IL_NEW();
84  g_drawables_2d = IL_NEW();
85  g_radarlinks = IL_NEW();
86  g_radaricons = IL_NEW();
87 }
88 
89 .void(entity) draw;
90 .void(entity) draw2d;
91 .void(entity) entremove;
94 
95 .float renderflags; // engine field
96 
100 
104 
105 void Fog_Force();
106 
107 string _getcommandkey(string text, string command, bool forcename);
108 #define getcommandkey(cmd_name, command) _getcommandkey(cmd_name, command, false)
109 #define getcommandkey_forcename(cmd_name, command) _getcommandkey(cmd_name, command, true)
110 
116 
118 
122 
123 float camera_active; // Demo camera is active if set to true
127 
128 const float ALPHA_MIN_VISIBLE = 0.003;
129 
132 
133 //hooks
135 const int HOOK_START = 1;
136 const int HOOK_END = 2;
137 
139 
141 
142 int hud;
144 
146 const int MAX_SPECTATORS = 7;
148 
150 
151 float GetSpeedUnitFactor(int speed_unit);
152 string GetSpeedUnit(int speed_unit);
153 
154 .int enttype; // entity type sent from server
155 .int sv_entnum; // entity number sent from server
156 
157 .int team;
159 
160 int binddb;
161 
162 // Spectating
163 // -1 - observing
164 // 0 - playing
165 // >0 - id of spectated player
168 
169 #define player_currententnum (spectatee_status > 0 ? spectatee_status : player_localnum + 1)
170 
171 // short mapname
173 
174 // database for misc stuff
175 int tempdb;
177 vector hook_shotorigin[4]; // WEAPONTODO
178 vector lightning_shotorigin[4]; // TODO: unused
179 
181 
182 float ticrate;
183 
int binddb
Definition: main.qh:160
bool autocvar__hud_showbinds_reload
Definition: main.qh:18
string shortmapname
Definition: main.qh:172
const float ALPHA_MIN_VISIBLE
Definition: main.qh:128
int serverflags
Definition: main.qh:184
STATIC_INIT(main)
Definition: main.qh:81
vector camera_direction
Definition: main.qh:126
entity teamslots[17]
Definition: main.qh:71
int vid_height
Definition: main.qh:120
vector lightning_shotorigin[4]
Definition: main.qh:178
int team
Definition: main.qh:157
int team_size
Definition: main.qh:158
bool autocvar_hud_showbinds_limit
Definition: main.qh:17
#define IL_NEW()
float FONT_USER
Definition: main.qh:34
IntrusiveList g_radarlinks
Definition: main.qh:79
entity() spawn
int sv_entnum
Definition: main.qh:155
void Fog_Force()
Definition: main.qc:1006
const int MAX_SPECTATORS
Definition: main.qh:146
vector view_origin
Definition: main.qh:93
vector hook_shotorigin[4]
Definition: main.qh:177
bool warmup_stage
Definition: main.qh:103
bool vote_waiting_for_me
Definition: main.qh:115
float current_viewzoom
Definition: main.qh:101
bool ready
Definition: main.qh:74
vector view_forward
Definition: main.qh:93
int ClientProgsDB
Definition: main.qh:176
limitations: NULL cannot be present elements can only be present once a maximum of IL_MAX lists can e...
void PostInit()
Definition: main.qc:434
void RemoveTeam(entity Team)
Definition: main.qc:282
int tempdb
Definition: main.qh:175
entity playerslots[255]
Definition: main.qh:70
float ping
Definition: main.qh:138
string _getcommandkey(string text, string command, bool forcename)
Definition: main.qc:1289
float autocvar_cl_spawn_point_dist_max
Definition: main.qh:11
entity owner
Definition: main.qh:73
float renderflags
Definition: main.qh:95
int calledhooks
Definition: main.qh:134
float grecordtime[RANKINGS_CNT]
Definition: main.qh:68
void RemovePlayer(entity player)
Definition: main.qc:232
entity teams
Definition: main.qh:44
float serverdeltatime
Definition: main.qh:180
void Gamemode_Init()
Definition: main.qc:955
vector view_up
Definition: main.qh:93
string vote_called_vote
Definition: main.qh:111
string grecordholder[RANKINGS_CNT]
Definition: main.qh:67
vector mi_center
Definition: main.qh:24
bool vote_waiting
Definition: main.qh:114
float RANKINGS_RECEIVED_CNT
Definition: main.qh:65
bool button_attack2
Definition: main.qh:99
bool ready_waiting_for_me
Definition: main.qh:113
float ping_packetloss
Definition: main.qh:138
bool autocvar_cl_spawn_event_sound
Definition: main.qh:8
string GetSpeedUnit(int speed_unit)
Definition: main.qc:1076
entity GetTeam(int Team, bool add)
Definition: main.qc:303
float damagepush_speedfactor
Definition: main.qh:131
vector mi_scale
Definition: main.qh:25
bool ready_waiting
Definition: main.qh:112
float current_zoomfraction
Definition: main.qh:117
void AuditLists()
Definition: main.qc:196
float chase_active_backup
Definition: main.qh:124
entity gametype
Definition: main.qh:30
const int HOOK_END
Definition: main.qh:136
const int HOOK_START
Definition: main.qh:135
bool autocvar_cl_unpress_zoom_on_spawn
Definition: main.qh:12
int num_spectators
Definition: main.qh:145
vector view_right
Definition: main.qh:93
bool button_zoom
Definition: main.qh:97
bool autocvar_cl_unpress_attack_on_weapon_switch
Definition: main.qh:15
bool autocvar_cl_unpress_zoom_on_death
Definition: main.qh:13
bool postinit
Definition: main.qh:29
vector(float skel, float bonenum) _skel_get_boneabs_hidden
bool autocvar_cl_race_cptimes_onlyself
Definition: main.qh:20
float GetSpeedUnitFactor(int speed_unit)
Definition: main.qc:1063
entity players
Definition: main.qh:43
float spectatee_status
Definition: main.qh:166
bool autocvar_cl_unpress_zoom_on_weapon_switch
Definition: main.qh:14
float RegisterPlayer(entity player)
Definition: main.qc:216
float camera_active
Definition: main.qh:123
float drawframetime
Definition: main.qh:92
float view_quality
Definition: main.qh:143
float vid_pixelheight
Definition: main.qh:121
float ping_movementloss
Definition: main.qh:138
float team_count
Definition: main.qh:45
string minimapname
Definition: main.qh:27
float spectatee_status_changed_time
Definition: main.qh:167
void main()
Definition: main.qc:506
vector hud_fontsize
Definition: main.qh:63
bool autocvar_cl_spawn_event_particles
Definition: main.qh:7
int enttype
Definition: main.qh:154
void MoveToLast(entity e)
Definition: main.qc:251
bool autocvar_cl_spawn_point_particles
Definition: main.qh:10
int vid_width
Definition: main.qh:120
int framecount
Definition: main.qh:149
float serverprevtime
Definition: main.qh:180
float RANKINGS_DISPLAY_CNT
Definition: main.qh:66
bool autocvar_developer_csqcentities
Definition: main.qh:19
float zoomin_effect
Definition: main.qh:102
int spectatorlist[MAX_SPECTATORS]
Definition: main.qh:147
bool autocvar_cl_db_saveasdump
Definition: main.qh:6
bool eliminated
Definition: main.qh:75
bool SetTeam(entity pl, int Team)
Definition: main.qc:319
IntrusiveList g_radaricons
Definition: main.qh:80
int cs_project_is_b0rked
Definition: main.qh:119
float armorblockpercent
Definition: main.qh:130
void Ent_Remove(entity this)
Definition: main.qc:920
bool autocvar_cl_race_cptimes_showself
Definition: main.qh:21
IntrusiveList g_drawables
Definition: main.qh:77
float RegisterTeam(entity Team)
Definition: main.qc:263
float g_trueaim_minrange
Definition: main.qh:140
float ticrate
Definition: main.qh:182
bool spectatorbutton_zoom
Definition: main.qh:98
IntrusiveList g_drawables_2d
Definition: main.qh:78
bool autocvar_hud_showbinds
Definition: main.qh:16
bool gotscores
Definition: main.qh:72
int hud
Definition: main.qh:142
float camera_roll
Definition: main.qh:125