]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/server/compat/quake3.qh
321c6fb4feb5ace4bb736d766a48892afdfefe54
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / compat / quake3.qh
1 #pragma once
2
3 int q3compat = 0;
4 #define Q3COMPAT_ARENA BIT(0)
5 #define Q3COMPAT_DEFI BIT(1)
6
7 bool DoesQ3ARemoveThisEntity(entity this);
8
9 .int fragsfilter_cnt;
10
11 /* We tell the ammo spawnfunc which weapon will use the ammo so it can
12  * calculate the amount required for the number of shots in the count field,
13  * and so the type can be looked up rather than specified in quake3.qc
14  */
15 // Ammo only, unconditional
16 #define SPAWNFUNC_Q3AMMO(ammo_classname, xonwep) \
17         spawnfunc(ammo_classname) \
18         { \
19                 if(this.count && xonwep.ammo_type) \
20                         SetResource(this, xonwep.ammo_type, this.count * GetAmmoConsumptionPrimary(xonwep.netname)); \
21         SPAWNFUNC_BODY(GetAmmoItem(xonwep.ammo_type)) \
22         }
23
24 // Ammo only, conditional
25 #define SPAWNFUNC_Q3AMMO_COND(ammo_classname, cond, xonwep1, xonwep0) \
26         SPAWNFUNC_Q3AMMO(ammo_classname, (cond ? xonwep1 : xonwep0))
27
28 // Weapon & ammo, unconditional
29 #define SPAWNFUNC_Q3(weapon_classname, ammo_classname, xonwep) \
30         SPAWNFUNC_WEAPON(weapon_classname, xonwep) \
31         SPAWNFUNC_Q3AMMO(ammo_classname, xonwep)
32
33 // Weapon & ammo, conditional
34 #define SPAWNFUNC_Q3_COND(weapon_classname, ammo_classname, cond, xonwep1, xonwep0) \
35         SPAWNFUNC_WEAPON_COND(weapon_classname, cond, xonwep1, xonwep0) \
36         SPAWNFUNC_Q3AMMO_COND(ammo_classname, cond, xonwep1, xonwep0)
37