Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
quake3.qc File Reference
Include dependency graph for quake3.qc:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define FRAGSFILTER_REMOVER   BIT(0)
#define FRAGSFILTER_RESET   BIT(3)
#define FRAGSFILTER_RUNONCE   BIT(1)
#define FRAGSFILTER_SILENT   BIT(2)
#define PRINT_BLUETEAM   BIT(1)
#define PRINT_BROADCAST   BIT(3)
#define PRINT_PRIVATE   BIT(2)
#define PRINT_REDTEAM   BIT(0)

Functions

bool DoesQ3ARemoveThisEntity (entity this)
 SPAWNFUNC_Q3 (weapon_shotgun, ammo_shells, q3compat==Q3COMPAT_ARENA ? WEP_MACHINEGUN :WEP_SHOTGUN, q3compat==Q3COMPAT_ARENA ? 8 :1) SPAWNFUNC_Q3(weapon_machinegun

Variables

 ammo_bullets
string not_gametype
 q3compat == Q3COMPAT_ARENA ? WEP_SHOTGUN : WEP_MACHINEGUN

Macro Definition Documentation

◆ FRAGSFILTER_REMOVER

#define FRAGSFILTER_REMOVER   BIT(0)

◆ FRAGSFILTER_RESET

#define FRAGSFILTER_RESET   BIT(3)

◆ FRAGSFILTER_RUNONCE

#define FRAGSFILTER_RUNONCE   BIT(1)

◆ FRAGSFILTER_SILENT

#define FRAGSFILTER_SILENT   BIT(2)

◆ PRINT_BLUETEAM

#define PRINT_BLUETEAM   BIT(1)

◆ PRINT_BROADCAST

#define PRINT_BROADCAST   BIT(3)

◆ PRINT_PRIVATE

#define PRINT_PRIVATE   BIT(2)

◆ PRINT_REDTEAM

#define PRINT_REDTEAM   BIT(0)

Function Documentation

◆ DoesQ3ARemoveThisEntity()

bool DoesQ3ARemoveThisEntity ( entity this)

Definition at line 299 of file quake3.qc.

300{
301 // Q3 style filters (DO NOT USE, THIS IS COMPAT ONLY)
302
303 if (!this.classname)
304 return true;
305
306 // DeFRaG mappers use "notcpm" or "notvq3" to disable an entity in CPM or VQ3 physics
307 // Xonotic is usually played with a CPM-based physics so we default to CPM mode
308 if(cvar_string("g_mod_physics") == "Q3")
309 {
310 if(stof(GetField_fullspawndata(this, "notvq3", false)))
311 return true;
312 }
313 else if(stof(GetField_fullspawndata(this, "notcpm", false)))
314 return true;
315
316 // Q3 mappers use "notq3a" or "notta" to disable an entity in Q3A or Q3TA
317 // Xonotic has ~equivalent features to Team Arena
318 if(stof(GetField_fullspawndata(this, "notta", false)))
319 return true;
320
321 // FIXME: singleplayer does not use maxclients 1 as that would prevent bots,
322 // this is the case in Q3 also, it uses another method to block clients.
323 // Only accessible in VQ3, via the `spmap` command.
324 if(stof(GetField_fullspawndata(this, "notsingle", false)))
325 if(maxclients == 1 && IS_GAMETYPE(DEATHMATCH))
326 return true;
327
328 if(stof(GetField_fullspawndata(this, "notteam", false)))
329 if(teamplay)
330 return true;
331
332 if(stof(GetField_fullspawndata(this, "notfree", false)))
333 if(!teamplay)
334 return true;
335
336 if(this.gametype || this.not_gametype)
337 {
338 // Q3 checks these with strstr(): case-sensitive, no gametype can be a substring of another,
339 // any separator is allowed (conventions are: spaces, commas, or commas with spaces).
340 // QL's entities.def says they're space delineated.
341
342 // Q3 gametype entity fields: ffa tournament single team ctf oneflag obelisk harvester (game/g_spawn.c)
343 // Q3 arena file 'type' key: ffa tourney ctf oneflag overload harvester (ui/ui_gameinfo.c)
344
345 // QL gametype entity fields: ffa duel tdm ca ft rr ctf ad dom har 1f race ob
346 // QL arena file 'type' key: ffa duel tdm ca ft rr ctf ad dom har oneflag race
347
348 string gametypename_q3, gametypename_ql;
349
350 // One of these will apply if our gametype has no Q3/QL equivalent
351 if(teamplay)
352 {
353 gametypename_q3 = "team";
354 gametypename_ql = "tdm";
355 }
356 else
357 gametypename_q3 = gametypename_ql = "ffa";
358
359 if(g_ctf)
360 {
361 if (cvar("g_ctf_oneflag"))
362 {
363 gametypename_q3 = "oneflag";
364 gametypename_ql = "1f";
365 }
366 else
367 gametypename_q3 = gametypename_ql = "ctf";
368 }
369 else if(g_duel)
370 {
371 gametypename_q3 = "tournament";
372 gametypename_ql = "duel";
373 }
374 else if(IS_GAMETYPE(DEATHMATCH) && maxclients == 1)
375 gametypename_q3 = "single";
376 else if(g_ca)
377 gametypename_ql = "ql";
378 else if(IS_GAMETYPE(FREEZETAG))
379 gametypename_ql = "ft";
380 else if(IS_GAMETYPE(DOMINATION))
381 gametypename_ql = "dom";
382 else if(g_race || g_cts)
383 gametypename_ql = "race";
384
385 if(this.gametype)
386 if(strstrofs(this.gametype, gametypename_q3, 0) < 0
387 && strstrofs(this.gametype, gametypename_ql, 0) < 0)
388 return true;
389
390 // Only supported by QL
391 if(strstrofs(this.not_gametype, gametypename_ql, 0) >= 0)
392 return true;
393 }
394
395 return false;
396}
#define g_ca
Definition clanarena.qh:51
entity gametype
Definition main.qh:43
#define g_race
Definition race.qh:48
string classname
float maxclients
#define g_ctf
Definition ctf.qh:39
#define g_cts
Definition cts.qh:36
#define strstrofs
#define g_duel
Definition duel.qh:32
float stof(string val,...)
float cvar(string name)
const string cvar_string(string name)
string not_gametype
Definition quake3.qc:298
string GetField_fullspawndata(entity e, string fieldname, bool vfspath)
Retrieves the value of a map entity field from fullspawndata.
Definition main.qc:451
bool teamplay
Definition teams.qh:59

References classname, cvar(), cvar_string(), entity(), g_ca, g_ctf, g_cts, g_duel, g_race, gametype, GetField_fullspawndata(), maxclients, not_gametype, stof(), strstrofs, and teamplay.

Referenced by SV_OnEntityPreSpawnFunction().

◆ SPAWNFUNC_Q3()

SPAWNFUNC_Q3 ( weapon_shotgun ,
ammo_shells ,
q3compat = Q3COMPAT_ARENA ? WEP_MACHINEGUN : WEP_SHOTGUN,
q3compat = Q3COMPAT_ARENA ? 8 : 1 )

References ammo_shells, q3compat, and Q3COMPAT_ARENA.

Variable Documentation

◆ ammo_bullets

ammo_bullets

Definition at line 58 of file quake3.qc.

◆ not_gametype

string not_gametype

Definition at line 298 of file quake3.qc.

Referenced by DoesQ3ARemoveThisEntity().

◆ q3compat