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

Go to the source code of this file.

Macros

#define ACCUMULATE_FUNCTION(func, otherfunc)
#define CALL_ACCUMULATED_FUNCTION(func)
#define CHECK_MAX_COUNT(name, max, count, type)
#define SET_FIELD_COUNT(field, first, count)
#define SET_FIRST_OR_LAST(input, first, count)

Functions

void ACCUMULATE_call (string func)

Macro Definition Documentation

◆ ACCUMULATE_FUNCTION

#define ACCUMULATE_FUNCTION ( func,
otherfunc )
Value:
.float _ACCUMULATE_##func##__##otherfunc;

Definition at line 31 of file accumulate.qh.

31 #define ACCUMULATE_FUNCTION(func, otherfunc) \
32 .float _ACCUMULATE_##func##__##otherfunc;

◆ CALL_ACCUMULATED_FUNCTION

#define CALL_ACCUMULATED_FUNCTION ( func)
Value:
void ACCUMULATE_call(string func)
Definition accumulate.qh:33

Definition at line 45 of file accumulate.qh.

45 #define CALL_ACCUMULATED_FUNCTION(func) \
46 ACCUMULATE_call( #func)

Referenced by GenericCommand_restartnotifs().

◆ CHECK_MAX_COUNT

#define CHECK_MAX_COUNT ( name,
max,
count,
type )
Value:
if (count > max) \
error(strcat("Maximum ", type, " hit: ", #name, ": ", ftos(count), ".\n"));
float count
Definition powerups.qc:22
string name
Definition menu.qh:30
string ftos(float f)
float max(float f,...)
strcat(_("^F4Countdown stopped!"), "\n^BG", _("Teams are too unbalanced."))

Definition at line 60 of file accumulate.qh.

60#define CHECK_MAX_COUNT(name, max, count, type) \
61 if (count > max) \
62 error(strcat("Maximum ", type, " hit: ", #name, ": ", ftos(count), ".\n"));

◆ SET_FIELD_COUNT

#define SET_FIELD_COUNT ( field,
first,
count )
Value:
if (!field) \
{ \
field = first + count; \
++count; \
}

Definition at line 54 of file accumulate.qh.

54#define SET_FIELD_COUNT(field, first, count) \
55 if (!field) \
56 { \
57 field = first + count; \
58 ++count; \
59 }

◆ SET_FIRST_OR_LAST

#define SET_FIRST_OR_LAST ( input,
first,
count )
Value:
if (!input) \
input = first + count;

Definition at line 51 of file accumulate.qh.

51#define SET_FIRST_OR_LAST(input, first, count) \
52 if (!input) \
53 input = first + count;

Function Documentation

◆ ACCUMULATE_call()

void ACCUMULATE_call ( string func)

Definition at line 33 of file accumulate.qh.

34 {
35 int n = numentityfields();
36 string name, funcprefix = strcat("_ACCUMULATE_", func, "__");
37 float funcprefixlen = strlen(funcprefix);
38 for (int i = 0; i < n; ++i)
39 {
40 name = entityfieldname(i);
41 if (substring(name, 0, funcprefixlen) == funcprefix)
42 callfunction(substring(name, funcprefixlen, -1));
43 }
44 }
#define strlen
string substring(string s, float start, float length)
void callfunction(...)

References callfunction(), name, strcat(), strlen, and substring().