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

Go to the source code of this file.

Macros

#define autocvar_slowmo   cvar("slowmo")
 

Functions

void dedicated_print (string input)
 print(), but only print if the server is not local More...
 
bool dropclient_schedule (entity this)
 Schedules dropclient for a player and returns true; if dropclient is already scheduled (for that player) it does nothing and returns false. More...
 
void main ()
 
void remove_except_protected (entity e)
 
void remove_safely (entity e)
 
void remove_unsafely (entity e)
 

Variables

float autocvar_g_balance_contents_damagerate
 
float autocvar_g_balance_contents_drowndelay
 
int autocvar_g_balance_contents_playerdamage_drowning
 
int autocvar_g_balance_contents_playerdamage_lava
 
int autocvar_g_balance_contents_playerdamage_lava_burn
 
float autocvar_g_balance_contents_playerdamage_lava_burn_time = 2.5
 
int autocvar_g_balance_contents_playerdamage_slime
 
int autocvar_g_balance_contents_projectiledamage
 
float autocvar_g_balance_falldamage_deadminspeed
 
float autocvar_g_balance_falldamage_factor
 
int autocvar_g_balance_falldamage_maxdamage
 
float autocvar_g_balance_falldamage_minspeed
 
bool autocvar_g_balance_falldamage_onlyvertical
 
float autocvar_sys_ticrate
 
float contents_damagetime
 
bool iscreature
 
vector oldvelocity
 
float remove_except_protected_forbidden
 
float serverframetime
 
float serverprevtime
 
float servertime
 
float species
 
float watersound_finished
 

Macro Definition Documentation

◆ autocvar_slowmo

#define autocvar_slowmo   cvar("slowmo")

Definition at line 16 of file main.qh.

Referenced by anticheat_physics(), and StartFrame().

Function Documentation

◆ dedicated_print()

void dedicated_print ( string  input)

print(), but only print if the server is not local

Definition at line 205 of file main.qc.

References print(), and server_is_dedicated.

Referenced by GameLogEcho(), and Say().

206 {
207  if (server_is_dedicated) print(input);
208 }
bool server_is_dedicated
Definition: world.qh:37
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dropclient_schedule()

bool dropclient_schedule ( entity  this)

Schedules dropclient for a player and returns true; if dropclient is already scheduled (for that player) it does nothing and returns false.

NOTE: this function exists only to allow sending a message to the kicked player with Send_Notification, which doesn't work if called together with dropclient

Definition at line 42 of file main.qc.

References dropclient_do(), entity(), FOREACH_ENTITY_CLASS, new_pure, setthink, and time.

Referenced by MUTATOR_HOOKFUNCTION(), PlayerPostThink(), and PlayerPreThink().

43 {
44  bool scheduled = false;
45  FOREACH_ENTITY_CLASS("dropclient_handler", true,
46  {
47  if(it.owner == this)
48  {
49  scheduled = true;
50  break; // can't use return here, compiler shows a warning
51  }
52  });
53  if (scheduled)
54  return false;
55 
56  entity e = new_pure(dropclient_handler);
58  e.owner = this;
59  e.nextthink = time + 0.1;
60  return true;
61 }
void dropclient_do(entity this)
Definition: main.qc:29
entity() spawn
#define FOREACH_ENTITY_CLASS(class, cond, body)
Definition: iter.qh:189
#define new_pure(class)
purely logical entities (.origin doesn't work)
Definition: oo.qh:62
#define setthink(e, f)
float time
Definition: csprogsdefs.qc:16
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ main()

void main ( )

Definition at line 506 of file main.qc.

507 {
508 
509 }

◆ remove_except_protected()

void remove_except_protected ( entity  e)

Definition at line 241 of file main.qc.

References error().

Referenced by InitializeEntitiesRun().

242 {
243  if(e.remove_except_protected_forbidden)
244  error("not allowed to remove this at this point");
245  builtin_remove(e);
246 }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ remove_safely()

void remove_safely ( entity  e)

Definition at line 255 of file main.qc.

References make_safe_for_remove().

Referenced by spawnfunc().

256 {
258  builtin_remove(e);
259 }
void make_safe_for_remove(entity e)
Definition: main.qc:210
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ remove_unsafely()

void remove_unsafely ( entity  e)

Definition at line 248 of file main.qc.

References error().

Referenced by InitializeEntitiesRun(), spawnfunc(), and StartFrame().

249 {
250  if(e.classname == "spike")
251  error("Removing spikes is forbidden (crylink bug), please report");
252  builtin_remove(e);
253 }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ autocvar_g_balance_contents_damagerate

float autocvar_g_balance_contents_damagerate

Definition at line 3 of file main.qh.

Referenced by CreatureFrame_hotliquids(), and DrownPlayer().

◆ autocvar_g_balance_contents_drowndelay

float autocvar_g_balance_contents_drowndelay

Definition at line 4 of file main.qh.

Referenced by DrownPlayer().

◆ autocvar_g_balance_contents_playerdamage_drowning

int autocvar_g_balance_contents_playerdamage_drowning

Definition at line 5 of file main.qh.

Referenced by DrownPlayer().

◆ autocvar_g_balance_contents_playerdamage_lava

int autocvar_g_balance_contents_playerdamage_lava

Definition at line 6 of file main.qh.

Referenced by CreatureFrame_hotliquids().

◆ autocvar_g_balance_contents_playerdamage_lava_burn

int autocvar_g_balance_contents_playerdamage_lava_burn

Definition at line 7 of file main.qh.

Referenced by CreatureFrame_hotliquids().

◆ autocvar_g_balance_contents_playerdamage_lava_burn_time

float autocvar_g_balance_contents_playerdamage_lava_burn_time = 2.5

Definition at line 8 of file main.qh.

Referenced by CreatureFrame_hotliquids().

◆ autocvar_g_balance_contents_playerdamage_slime

int autocvar_g_balance_contents_playerdamage_slime

Definition at line 9 of file main.qh.

Referenced by CreatureFrame_hotliquids().

◆ autocvar_g_balance_contents_projectiledamage

int autocvar_g_balance_contents_projectiledamage

Definition at line 10 of file main.qh.

Referenced by CreatureFrame_hotliquids().

◆ autocvar_g_balance_falldamage_deadminspeed

float autocvar_g_balance_falldamage_deadminspeed

Definition at line 11 of file main.qh.

Referenced by CreatureFrame_FallDamage().

◆ autocvar_g_balance_falldamage_factor

float autocvar_g_balance_falldamage_factor

Definition at line 12 of file main.qh.

Referenced by CreatureFrame_FallDamage().

◆ autocvar_g_balance_falldamage_maxdamage

int autocvar_g_balance_falldamage_maxdamage

Definition at line 13 of file main.qh.

Referenced by CreatureFrame_FallDamage().

◆ autocvar_g_balance_falldamage_minspeed

float autocvar_g_balance_falldamage_minspeed

Definition at line 14 of file main.qh.

Referenced by CreatureFrame_FallDamage().

◆ autocvar_g_balance_falldamage_onlyvertical

bool autocvar_g_balance_falldamage_onlyvertical

Definition at line 15 of file main.qh.

Referenced by CreatureFrame_FallDamage().

◆ autocvar_sys_ticrate

float autocvar_sys_ticrate

Definition at line 17 of file main.qh.

Referenced by StartFrame().

◆ contents_damagetime

float contents_damagetime

Definition at line 45 of file main.qh.

Referenced by CreatureFrame_hotliquids(), and CreatureFrame_Liquids().

◆ iscreature

◆ oldvelocity

◆ remove_except_protected_forbidden

float remove_except_protected_forbidden

Definition at line 24 of file main.qh.

◆ serverframetime

float serverframetime

Definition at line 36 of file main.qh.

Referenced by Drag_Update(), and StartFrame().

◆ serverprevtime

float serverprevtime

Definition at line 36 of file main.qh.

◆ servertime

◆ species

float species

Definition at line 43 of file main.qh.

Referenced by CopyBody().

◆ watersound_finished

float watersound_finished

Definition at line 40 of file main.qh.

Referenced by CreatureFrame_hotliquids().