Xonotic
quake3.qh File Reference
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define Q3COMPAT_ARENA   BIT(0)
 
#define Q3COMPAT_DEFI   BIT(1)
 
#define SPAWNFUNC_Q3(weapon_classname, ammo_classname, xonwep)
 
#define SPAWNFUNC_Q3_COND(weapon_classname, ammo_classname, cond, xonwep1, xonwep0)
 
#define SPAWNFUNC_Q3AMMO(ammo_classname, xonwep)
 
#define SPAWNFUNC_Q3AMMO_COND(ammo_classname, cond, xonwep1, xonwep0)   SPAWNFUNC_Q3AMMO(ammo_classname, (cond ? xonwep1 : xonwep0))
 

Functions

bool DoesQ3ARemoveThisEntity (entity this)
 
int GetAmmoConsumptionQ3 (string netname)
 

Variables

bool autocvar_sv_q3compat_changehitbox
 
int fragsfilter_cnt
 
int q3compat = 0
 

Macro Definition Documentation

◆ Q3COMPAT_ARENA

#define Q3COMPAT_ARENA   BIT(0)

Definition at line 4 of file quake3.qh.

Referenced by spawnfunc().

◆ Q3COMPAT_DEFI

#define Q3COMPAT_DEFI   BIT(1)

Definition at line 5 of file quake3.qh.

Referenced by spawnfunc().

◆ SPAWNFUNC_Q3

#define SPAWNFUNC_Q3 (   weapon_classname,
  ammo_classname,
  xonwep 
)
Value:
SPAWNFUNC_WEAPON(weapon_classname, xonwep) \
SPAWNFUNC_Q3AMMO(ammo_classname, xonwep)
#define SPAWNFUNC_WEAPON(name, weapon)
Definition: weapon.qh:143

Definition at line 32 of file quake3.qh.

◆ SPAWNFUNC_Q3_COND

#define SPAWNFUNC_Q3_COND (   weapon_classname,
  ammo_classname,
  cond,
  xonwep1,
  xonwep0 
)
Value:
SPAWNFUNC_WEAPON_COND(weapon_classname, cond, xonwep1, xonwep0) \
SPAWNFUNC_Q3AMMO_COND(ammo_classname, cond, xonwep1, xonwep0)

Definition at line 37 of file quake3.qh.

◆ SPAWNFUNC_Q3AMMO

#define SPAWNFUNC_Q3AMMO (   ammo_classname,
  xonwep 
)
Value:
spawnfunc(ammo_classname) \
{ \
if(this.count && xonwep.ammo_type) \
SetResource(this, xonwep.ammo_type, this.count * GetAmmoConsumptionQ3(xonwep.netname)); \
SPAWNFUNC_BODY(GetAmmoItem(xonwep.ammo_type)) \
}
entity GetAmmoItem(Resource ammotype)
Definition: all.qc:234
spawnfunc(info_player_attacker)
Definition: sv_assault.qc:283
int GetAmmoConsumptionQ3(string netname)
Definition: quake3.qc:337
float count
Definition: powerups.qc:22

Definition at line 19 of file quake3.qh.

◆ SPAWNFUNC_Q3AMMO_COND

#define SPAWNFUNC_Q3AMMO_COND (   ammo_classname,
  cond,
  xonwep1,
  xonwep0 
)    SPAWNFUNC_Q3AMMO(ammo_classname, (cond ? xonwep1 : xonwep0))

Definition at line 28 of file quake3.qh.

Function Documentation

◆ DoesQ3ARemoveThisEntity()

bool DoesQ3ARemoveThisEntity ( entity  this)

Definition at line 282 of file quake3.qc.

References ctf_oneflag, cvar_string(), g_ctf, g_duel, gametype, maxclients, notcpm, notfree, notsingle, notta, notteam, notvq3, strstrofs, and teamplay.

Referenced by SV_OnEntityPreSpawnFunction().

283 {
284  // Q3 style filters (DO NOT USE, THIS IS COMPAT ONLY)
285 
286  // DeFRaG mappers use "notcpm" or "notvq3" to disable an entity in CPM or VQ3 physics
287  // Xonotic is usually played with a CPM-based physics so we default to CPM mode
288  if(cvar_string("g_mod_physics") == "Q3")
289  {
290  if(this.notvq3)
291  return true;
292  }
293  else if(this.notcpm)
294  return true;
295 
296  // Q3 mappers use "notq3a" or "notta" to disable an entity in Q3A or Q3TA
297  // Xonotic has ~equivalent features to Team Arena
298  if(this.notta)
299  return true;
300 
301  // FIXME: singleplayer does not use maxclients 1 as that would prevent bots
302  if(this.notsingle)
303  if(maxclients == 1)
304  return true;
305 
306  if(this.notteam)
307  if(teamplay)
308  return true;
309 
310  if(this.notfree)
311  if(!teamplay)
312  return true;
313 
314  if(this.gametype)
315  {
316  string gametypename;
317  // From ioq3 g_spawn.c: static char *gametypeNames[] = {"ffa", "tournament", "single", "team", "ctf", "oneflag", "obelisk", "harvester"};
318  gametypename = "ffa";
319  if(teamplay)
320  gametypename = "team";
321  if(g_ctf)
322  gametypename = "ctf";
323  if(g_ctf && ctf_oneflag)
324  gametypename = "oneflag";
325  if(g_duel)
326  gametypename = "tournament";
327  if(maxclients == 1)
328  gametypename = "single";
329  // we do not have the other types (obelisk, harvester)
330  if(strstrofs(this.gametype, gametypename, 0) < 0)
331  return true;
332  }
333 
334  return false;
335 }
bool notteam
Definition: quake3.qc:275
#define g_ctf
Definition: ctf.qh:39
bool notvq3
Definition: quake3.qc:279
float maxclients
Definition: csprogsdefs.qc:21
string gametype
Definition: quake3.qc:281
bool notsingle
Definition: quake3.qc:276
bool notta
Definition: quake3.qc:278
#define strstrofs
Definition: dpextensions.qh:42
float teamplay
Definition: progsdefs.qc:31
bool notfree
Definition: quake3.qc:277
bool ctf_oneflag
Definition: sv_ctf.qh:160
#define g_duel
Definition: duel.qh:28
bool notcpm
Definition: quake3.qc:280
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetAmmoConsumptionQ3()

int GetAmmoConsumptionQ3 ( string  netname)

Definition at line 337 of file quake3.qc.

References cvar(), and strcat().

Referenced by weapon_defaultspawnfunc().

340 {
341  switch (netname)
342  {
343  case "arc": return autocvar_g_balance_arc_beam_ammo;
344  case "devastator": return autocvar_g_balance_devastator_ammo;
345  case "machinegun": return autocvar_g_balance_machinegun_sustained_ammo;
346  case "minelayer": return autocvar_g_balance_minelayer_ammo;
347  case "seeker": return autocvar_g_balance_seeker_tag_ammo;
348  default: return cvar(strcat("g_balance_", netname, "_primary_ammo"));
349  }
350 }
string netname
Definition: powerups.qc:20
spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 f1 s1 strcat(_("Level %s: "), "^BG%s\3\, _("^BGPress ^F2%s^BG to enter the game"))
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ autocvar_sv_q3compat_changehitbox

bool autocvar_sv_q3compat_changehitbox

Definition at line 7 of file quake3.qh.

Referenced by PutPlayerInServer().

◆ fragsfilter_cnt

int fragsfilter_cnt

Definition at line 12 of file quake3.qh.

Referenced by PutPlayerInServer().

◆ q3compat

int q3compat = 0