#include "main.qh"
#include "miscfunctions.qh"
-#include "../dpdefs/csprogsdefs.qh"
-
#include "../common/models/all.qh"
#include "../common/sounds/all.qh"
#include "teamradar.qh"
#include "t_items.qh"
-#include "../dpdefs/keycodes.qh"
-
#include "../common/buffs/all.qh"
#include "../common/constants.qh"
#include "../common/deathtypes.qh"
#include "../common/constants.qh"
-#include "../dpdefs/keycodes.qh"
-
#define HUD_Write(s) fputs(fh, s)
// q: quoted, n: not quoted
#include "../common/mapinfo.qh"
#include "../common/util.qh"
-#include "../dpdefs/keycodes.qh"
-
int mv_num_maps;
-#include "../common/util-pre.qh"
-#include "../dpdefs/csprogsdefs.qh"
-#include "../common/util-post.qh"
-
#include "../lib/_all.inc"
#include "announcer.qc"
#include "hud_config.qh"
-#include "../dpdefs/keycodes.qh"
-
// QUICKMENU_MAXLINES must be <= 10
const int QUICKMENU_MAXLINES = 10;
// visible entries are loaded from QuickMenu_Buffer into QuickMenu_Page_* arrays
-#if defined(CSQC)
- #include "../dpdefs/csprogsdefs.qh"
- #include "animdecide.qh"
-#elif defined(MENUQC)
-#elif defined(SVQC)
- #include "../dpdefs/progsdefs.qh"
- #include "../dpdefs/dpextensions.qh"
+#include "animdecide.qh"
+#if defined(SVQC)
#include "util.qh"
- #include "animdecide.qh"
#include "../server/defs.qh"
#endif
#if defined(CSQC)
- #include "../../dpdefs/csprogsdefs.qh"
#include "../../client/defs.qh"
#elif defined(MENUQC)
#elif defined(SVQC)
- #include "../../dpdefs/progsdefs.qh"
- #include "../../dpdefs/dpextensions.qh"
#endif
#include "all.qh"
#if defined(CSQC)
#elif defined(MENUQC)
#elif defined(SVQC)
- #include "../dpdefs/progsdefs.qh"
- #include "../dpdefs/dpextensions.qh"
#include "util.qh"
#include "campaign_common.qh"
#endif
#if defined(CSQC)
#elif defined(MENUQC)
#elif defined(SVQC)
- #include "../dpdefs/progsdefs.qh"
#include "campaign_common.qh"
#include "mapinfo.qh"
#endif
#ifndef GAMEITEM_H
#define GAMEITEM_H
+
+const int IT_UNLIMITED_WEAPON_AMMO = 1; // when this bit is set, using a weapon does not reduce ammo. Checkpoints can give this powerup.
+const int IT_UNLIMITED_SUPERWEAPONS = 2; // when this bit is set, superweapons don't expire. Checkpoints can give this powerup.
+const int IT_CTF_SHIELDED = 4; // set for the flag shield
+const int IT_USING_JETPACK = 8; // confirmation that button is pressed
+const int IT_JETPACK = 16; // actual item
+const int IT_FUEL_REGEN = 32; // fuel regeneration trigger
+// where is 64... ?
+const int IT_FUEL = 128;
+// -Wdouble-declaration
+#define IT_SHELLS 256
+// -Wdouble-declaration
+#define IT_NAILS 512
+// -Wdouble-declaration
+#define IT_ROCKETS 1024
+// -Wdouble-declaration
+#define IT_CELLS 2048
+const int IT_SUPERWEAPON = 4096;
+const int IT_STRENGTH = 8192;
+const int IT_INVINCIBLE = 16384;
+const int IT_HEALTH = 32768;
+const int IT_PLASMA = 65536;
+
+// shared value space (union):
+ // for items:
+ // -Wdouble-declaration
+ #define IT_KEY1 131072
+ // -Wdouble-declaration
+ #define IT_KEY2 262144
+// end
+
+const int IT_5HP = 524288;
+const int IT_25HP = 1048576;
+const int IT_ARMOR_SHARD = 2097152;
+const int IT_ARMOR = 4194304;
+
+// item masks
+const int IT_AMMO = 3968; // IT_FUEL | IT_SHELLS | IT_NAILS | IT_ROCKETS | IT_CELLS | IT_PLASMA;
+const int IT_PICKUPMASK = 51; // IT_FUEL_REGEN | IT_JETPACK | IT_UNLIMITED_AMMO; // strength and invincible are handled separately
+const int IT_UNLIMITED_AMMO = 3; // IT_UNLIMITED_SUPERWEAPONS | IT_UNLIMITED_WEAPON_AMMO;
+
#define ITEM_HANDLE(signal, ...) __Item_Send_##signal(__VA_ARGS__)
/** If you register a new item, make sure to add it to all.inc */
CLASS(GameItem, Object)
#include "powerup.qh"
-#include "../../../server/t_items.qh"
#ifndef SVQC
.int m_itemid;
#if defined(CSQC)
- #include "../dpdefs/csprogsdefs.qh"
#include "../client/defs.qh"
#include "util.qh"
#include "buffs/all.qh"
#include "mapinfo.qh"
#elif defined(MENUQC)
#elif defined(SVQC)
- #include "../dpdefs/progsdefs.qh"
- #include "../dpdefs/dpextensions.qh"
#include "util.qh"
#include "buffs/all.qh"
#include "monsters/all.qh"
#ifndef CL_MINIGAMES_H
#define CL_MINIGAMES_H
-#include "../../dpdefs/keycodes.qh"
-
// Get a square in the center of the avaliable area
// \note macro to pass by reference pos and mySize
#define minigame_hud_fitsqare(pos, mySize) \
#if defined(CSQC)
#elif defined(MENUQC)
#elif defined(SVQC)
- #include "../../dpdefs/progsdefs.qh"
#include "../util.qh"
#include "all.qh"
#include "sv_monsters.qh"
#if defined(CSQC)
#elif defined(MENUQC)
#elif defined(SVQC)
- #include "../../dpdefs/progsdefs.qh"
- #include "../../dpdefs/dpextensions.qh"
#include "../../warpzonelib/common.qh"
#include "../constants.qh"
#include "../teams.qh"
#include "../physics.qh"
#if defined(CSQC)
- #include "../../dpdefs/csprogsdefs.qh"
#include "../../client/defs.qh"
#include "../stats.qh"
#include "../util.qh"
#if defined(CSQC)
- #include "../../dpdefs/csprogsdefs.qh"
#include "../../client/defs.qh"
#include "all.qh"
#include "../buffs/all.qh"
#include "../../csqcmodellib/cl_model.qh"
#elif defined(MENUQC)
#elif defined(SVQC)
- #include "../../dpdefs/progsdefs.qh"
#include "../constants.qh"
#include "../../server/constants.qh"
#include "../turrets/sv_turrets.qh"
#if defined(CSQC)
#elif defined(MENUQC)
#elif defined(SVQC)
- #include "../dpdefs/progsdefs.qh"
- #include "../dpdefs/dpextensions.qh"
#include "constants.qh"
#include "teams.qh"
#include "../server/autocvars.qh"
#if defined(CSQC)
#elif defined(MENUQC)
#elif defined(SVQC)
- #include "../dpdefs/progsdefs.qh"
- #include "../dpdefs/dpextensions.qh"
#include "constants.qh"
#include "util.qh"
#include "weapons/all.qh"
#if defined(CSQC)
#elif defined(MENUQC)
#elif defined(SVQC)
- #include "../../../dpdefs/progsdefs.qh"
#include "../../../warpzonelib/util_server.qh"
#include "../../../server/defs.qh"
#endif
+++ /dev/null
-#ifndef UTIL_POST_H
-#define UTIL_POST_H
-
-[[alias("self")]] entity __self;
-
-// Can't wrap with do-while as block may contain continue or break
-#define WITH(type, name, value, block) { \
- type __with_save = (name); \
- name = (value); \
- LAMBDA(block) \
- name = __with_save; \
-} do { } while (0)
-
-// Transition from global 'self' to local 'this'
-
-// Step 1: auto oldself
-#if 1
-#define SELFPARAM() noref entity this = __self
-#define setself(s) (__self = s)
-#define self __self
-#endif
-
-// Step 2: check SELFPARAM() is present for functions that use self
-#if 0
-#define SELFPARAM() [[alias("__self")]] noref entity this = __self
-#define setself(s) (__self = s)
-#define self this
-#endif
-
-// Step 3: const self
-#if 0
-#define SELFPARAM() noref const entity this = __self
-entity setself(entity e) { return self = e; }
-entity getself() { return self; }
-#define self getself()
-#endif
-
-// Step 4: enable when possible
-// TODO: Remove SELFPARAM in favor of a parameter
-#if 0
-#define SELFPARAM() noref const entity this = __self
-#define self this
-#endif
-
-#define spawn() new(entity)
-
-#endif
+++ /dev/null
-#ifndef UTIL_PRE_H
-#define UTIL_PRE_H
-
-#ifndef NOCOMPAT
- #define COMPAT_NO_MOD_IS_XONOTIC
-#endif
-
-#ifndef QCC_SUPPORT_ACCUMULATE
- #ifdef GMQCC
- #define QCC_SUPPORT_ACCUMULATE
- #endif
-#endif
-
-#ifndef QCC_SUPPORT_NIL
- #ifdef GMQCC
- #define QCC_SUPPORT_NIL 1
- #endif
-#endif
-
-#ifndef QCC_SUPPORT_INT
- #define int float
-
- #define stoi(s) stof(s)
- #define stob(s) stof(s)
- #define itos(i) ftos(i)
-#else
- #define stoi(s) ((int) stof(s))
- #define stob(s) ((bool) stof(s))
- #define itos(i) ftos(i)
-#endif
-
-#define FOREACH_ARRAY(arr, start, end, cond, body) do { \
- for (int i = start; i < end; ++i) { \
- const noref entity it = arr[i]; \
- if (cond) { body } \
- } \
-} while(0)
-
-#define FOREACH_LIST(list, next, cond, body) do { \
- noref int i = 0; \
- for (entity it = list##_first; it; (it = it.next, ++i)) { \
- if (cond) { body } \
- } \
-} while(0)
-
-#define FOREACH(list, cond, body) FOREACH_LIST(list, enemy, cond, body)
-
-#ifdef GMQCC
- #define EVAL(...) __VA_ARGS__
-
- #define OVERLOAD_(F, ...) F##_##__VA_COUNT__(__VA_ARGS__)
- #define OVERLOAD(F, ...) F##_##__VA_COUNT__(__VA_ARGS__)
-#else
- #define EMPTY()
- #define DEFER(id) id EMPTY()
-
- #define EVAL(...) EVAL1(EVAL1(EVAL1(__VA_ARGS__)))
- #define EVAL1(...) EVAL2(EVAL2(EVAL2(__VA_ARGS__)))
- #define EVAL2(...) EVAL3(EVAL3(EVAL3(__VA_ARGS__)))
- #define EVAL3(...) EVAL4(EVAL4(EVAL4(__VA_ARGS__)))
- #define EVAL4(...) EVAL5(EVAL5(EVAL5(__VA_ARGS__)))
- #define EVAL5(...) __VA_ARGS__
-
- #define OVERLOAD___(F,_16,_15,_14,_13,_12,_11,_10,_9,_8,_7,_6,_5,_4,_3,_2,_1,n,...) F##_##n
- #define OVERLOAD__(F, ...) OVERLOAD___(F,##__VA_ARGS__,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)
- #define OVERLOAD_(...) DEFER(OVERLOAD__(__VA_ARGS__))
- #define OVERLOAD(F, ...) OVERLOAD_(F,##__VA_ARGS__)(__VA_ARGS__)
-#endif
-
-#define LAMBDA(...) { __VA_ARGS__ ; }
-
-#define MAP(f, ...) EVAL(OVERLOAD(MAP, f, __VA_ARGS__))
-#define MAP_2(f, it) f(it)
-#define MAP_3(f, it, ...) f(it)MAP_2(f, __VA_ARGS__)
-#define MAP_4(f, it, ...) f(it)MAP_3(f, __VA_ARGS__)
-#define MAP_5(f, it, ...) f(it)MAP_4(f, __VA_ARGS__)
-#define MAP_6(f, it, ...) f(it)MAP_5(f, __VA_ARGS__)
-#define MAP_7(f, it, ...) f(it)MAP_6(f, __VA_ARGS__)
-#define MAP_8(f, it, ...) f(it)MAP_7(f, __VA_ARGS__)
-#define MAP_9(f, it, ...) f(it)MAP_8(f, __VA_ARGS__)
-#define MAP_10(f, it, ...) f(it)MAP_9(f, __VA_ARGS__)
-#define MAP_11(f, it, ...) f(it)MAP_10(f, __VA_ARGS__)
-#define MAP_12(f, it, ...) f(it)MAP_11(f, __VA_ARGS__)
-#define MAP_13(f, it, ...) f(it)MAP_12(f, __VA_ARGS__)
-#define MAP_14(f, it, ...) f(it)MAP_13(f, __VA_ARGS__)
-#define MAP_15(f, it, ...) f(it)MAP_14(f, __VA_ARGS__)
-#define MAP_16(f, it, ...) f(it)MAP_15(f, __VA_ARGS__)
-#define MAP_17(f, it, ...) f(it)MAP_16(f, __VA_ARGS__)
-#define MAP_18(f, it, ...) f(it)MAP_17(f, __VA_ARGS__)
-#define MAP_19(f, it, ...) f(it)MAP_18(f, __VA_ARGS__)
-#define MAP_20(f, it, ...) f(it)MAP_19(f, __VA_ARGS__)
-
-#define IDENTITY(it) it
-
-#define UNWORDS(...) MAP(IDENTITY, __VA_ARGS__)
-
-#define APPLY(f, ...) f(__VA_ARGS__)
-
-#ifdef SVQC
- #define SV(f, ...) f(__VA_ARGS__)
-#else
- #define SV(f, ...)
-#endif
-
-#ifdef CSQC
- #define CL(f, ...) f(__VA_ARGS__)
-#else
- #define CL(f, ...)
-#endif
-
-#define IF(cond, f, ...) cond(f, __VA_ARGS__)
-
-#define GET(name) name##get
-#define GETTER(type, name) type GET(name)() { return name; }
-
-#endif
#include "util.qh"
#if defined(CSQC)
- #include "../dpdefs/csprogsdefs.qh"
#include "../client/defs.qh"
#include "constants.qh"
#include "../client/mutators/events.qh"
#include "deathtypes.qh"
#elif defined(MENUQC)
#elif defined(SVQC)
- #include "../dpdefs/progsdefs.qh"
- #include "../dpdefs/dpextensions.qh"
#include "constants.qh"
#include "../server/autocvars.qh"
#include "../server/defs.qh"
#include "util.qh"
#if defined(CSQC)
- #include "../dpdefs/csprogsdefs.qh"
#include "../client/defs.qh"
#include "constants.qh"
#elif defined(MENUQC)
#include "all.qh"
#if defined(CSQC)
- #include "../../dpdefs/csprogsdefs.qh"
#include "../../client/defs.qh"
#include "../constants.qh"
#include "../stats.qh"
#include "../../csqcmodellib/cl_model.qh"
#elif defined(MENUQC)
#elif defined(SVQC)
- #include "../../dpdefs/progsdefs.qh"
- #include "../../dpdefs/dpextensions.qh"
#include "../../warpzonelib/anglestransform.qh"
#include "../../warpzonelib/common.qh"
#include "../../warpzonelib/util_server.qh"
#if defined(CSQC)
#elif defined(MENUQC)
#elif defined(SVQC)
- #include "../../dpdefs/progsdefs.qh"
- #include "../../dpdefs/dpextensions.qh"
#include "../util.qh"
#include "config.qh"
#include "all.qh"
* IN THE SOFTWARE.
*/
#if defined(CSQC)
- #include "../dpdefs/csprogsdefs.qh"
#include "../client/defs.qh"
#include "../common/util.qh"
#include "../common/animdecide.qh"
* IN THE SOFTWARE.
*/
#if defined(CSQC)
- #include "../dpdefs/csprogsdefs.qh"
#include "../client/defs.qh"
#include "../common/constants.qh"
#include "../common/stats.qh"
* IN THE SOFTWARE.
*/
#if defined(CSQC)
- #include "../dpdefs/csprogsdefs.qh"
#include "../client/defs.qh"
#include "../warpzonelib/anglestransform.qh"
#include "../client/autocvars.qh"
#if defined(CSQC)
#elif defined(MENUQC)
#elif defined(SVQC)
- #include "../dpdefs/progsdefs.qh"
- #include "../dpdefs/dpextensions.qh"
#include "../common/constants.qh"
#include "../common/util.qh"
#include "../common/animdecide.qh"
-#include "bool.qh"
+#ifndef NOCOMPAT
+ #define COMPAT_NO_MOD_IS_XONOTIC
+#endif
+
+#include "compiler.qh"
+
+#ifndef QCC_SUPPORT_INT
+ #define int float
+#endif
+
+#ifndef QCC_SUPPORT_BOOL
+ #define bool float
+#endif
+
+#if defined(CSQC)
+ #include "../dpdefs/csprogsdefs.qh"
+ #include "../dpdefs/keycodes.qh"
+#elif defined(SVQC)
+ #include "../server/sys-pre.qh"
+ #include "../dpdefs/progsdefs.qh"
+ #include "../dpdefs/dpextensions.qh"
+ #include "../server/sys-post.qh"
+#elif defined(MENUQC)
+ #include "../dpdefs/menudefs.qh"
+ #include "../dpdefs/keycodes.qh"
+#endif
#include "../warpzonelib/mathlib.qc"
#include "accumulate.qh"
#include "bits.qh"
+#include "bool.qh"
#include "counting.qh"
#include "cvar.qh"
#include "defer.qh"
#include "draw.qh"
#include "file.qh"
+#include "functional.qh"
#include "i18n.qh"
+#include "int.qh"
+#include "iter.qh"
#include "lazy.qh"
#include "log.qh"
#include "math.qh"
+#include "misc.qh"
#include "net.qh"
#include "nil.qh"
#include "noise.qc"
#include "random.qc"
#include "registry.qh"
#include "replicate.qh"
-#include "sort.qh"
+#include "self.qh"
#include "sortlist.qc"
+#include "sort.qh"
#include "spawnfunc.qh"
#include "static.qh"
#include "string.qh"
#define BOOL_H
#ifndef QCC_SUPPORT_BOOL
- #define bool float
-
// Boolean Constants
const int true = 1;
const int false = 0;
--- /dev/null
+#ifndef COMPILER_H
+#define COMPILER_H
+
+#ifndef QCC_SUPPORT_ACCUMULATE
+ #ifdef GMQCC
+ #define QCC_SUPPORT_ACCUMULATE
+ #endif
+#endif
+
+#ifndef QCC_SUPPORT_NIL
+ #ifdef GMQCC
+ #define QCC_SUPPORT_NIL
+ #endif
+#endif
+
+#endif
#ifndef MENUQC
#ifndef DEFER_H
#define DEFER_H
+
#include "oo.qh"
+#include "self.qh"
entityclass(Defer);
class(Defer) .entity owner;
--- /dev/null
+#ifndef FUNCTIONAL_H
+#define FUNCTIONAL_H
+
+#define MAP(f, ...) EVAL(OVERLOAD(MAP, f, __VA_ARGS__))
+#define MAP_2(f, it) f(it)
+#define MAP_3(f, it, ...) f(it)MAP_2(f, __VA_ARGS__)
+#define MAP_4(f, it, ...) f(it)MAP_3(f, __VA_ARGS__)
+#define MAP_5(f, it, ...) f(it)MAP_4(f, __VA_ARGS__)
+#define MAP_6(f, it, ...) f(it)MAP_5(f, __VA_ARGS__)
+#define MAP_7(f, it, ...) f(it)MAP_6(f, __VA_ARGS__)
+#define MAP_8(f, it, ...) f(it)MAP_7(f, __VA_ARGS__)
+#define MAP_9(f, it, ...) f(it)MAP_8(f, __VA_ARGS__)
+#define MAP_10(f, it, ...) f(it)MAP_9(f, __VA_ARGS__)
+#define MAP_11(f, it, ...) f(it)MAP_10(f, __VA_ARGS__)
+#define MAP_12(f, it, ...) f(it)MAP_11(f, __VA_ARGS__)
+#define MAP_13(f, it, ...) f(it)MAP_12(f, __VA_ARGS__)
+#define MAP_14(f, it, ...) f(it)MAP_13(f, __VA_ARGS__)
+#define MAP_15(f, it, ...) f(it)MAP_14(f, __VA_ARGS__)
+#define MAP_16(f, it, ...) f(it)MAP_15(f, __VA_ARGS__)
+#define MAP_17(f, it, ...) f(it)MAP_16(f, __VA_ARGS__)
+#define MAP_18(f, it, ...) f(it)MAP_17(f, __VA_ARGS__)
+#define MAP_19(f, it, ...) f(it)MAP_18(f, __VA_ARGS__)
+#define MAP_20(f, it, ...) f(it)MAP_19(f, __VA_ARGS__)
+
+#define IDENTITY(it) it
+
+#define UNWORDS(...) MAP(IDENTITY, __VA_ARGS__)
+
+#define APPLY(f, ...) f(__VA_ARGS__)
+
+#ifdef SVQC
+ #define SV(f, ...) f(__VA_ARGS__)
+#else
+ #define SV(f, ...)
+#endif
+
+#ifdef CSQC
+ #define CL(f, ...) f(__VA_ARGS__)
+#else
+ #define CL(f, ...)
+#endif
+
+#define IF(cond, f, ...) cond(f, __VA_ARGS__)
+
+#endif
--- /dev/null
+#ifndef INT_H
+#define INT_H
+
+#ifndef QCC_SUPPORT_INT
+ #define stoi(s) stof(s)
+ #define stob(s) stof(s)
+ #define itos(i) ftos(i)
+#else
+ #define stoi(s) ((int) stof(s))
+ #define stob(s) ((bool) stof(s))
+ #define itos(i) ftos(i)
+#endif
+
+#endif
--- /dev/null
+#ifndef ITER_H
+#define ITER_H
+
+#define FOREACH_ARRAY(arr, start, end, cond, body) do { \
+ for (int i = start; i < end; ++i) { \
+ const noref entity it = arr[i]; \
+ if (cond) { body } \
+ } \
+} while(0)
+
+#define FOREACH_LIST(list, next, cond, body) do { \
+ noref int i = 0; \
+ for (entity it = list##_first; it; (it = it.next, ++i)) { \
+ if (cond) { body } \
+ } \
+} while(0)
+
+#define FOREACH(list, cond, body) FOREACH_LIST(list, enemy, cond, body)
+
+#endif
--- /dev/null
+#ifndef MISC_H
+#define MISC_H
+
+#ifdef GMQCC
+ #define EVAL(...) __VA_ARGS__
+
+ #define OVERLOAD_(F, ...) F##_##__VA_COUNT__(__VA_ARGS__)
+ #define OVERLOAD(F, ...) F##_##__VA_COUNT__(__VA_ARGS__)
+#else
+ #define EMPTY()
+ #define DEFER(id) id EMPTY()
+
+ #define EVAL(...) EVAL1(EVAL1(EVAL1(__VA_ARGS__)))
+ #define EVAL1(...) EVAL2(EVAL2(EVAL2(__VA_ARGS__)))
+ #define EVAL2(...) EVAL3(EVAL3(EVAL3(__VA_ARGS__)))
+ #define EVAL3(...) EVAL4(EVAL4(EVAL4(__VA_ARGS__)))
+ #define EVAL4(...) EVAL5(EVAL5(EVAL5(__VA_ARGS__)))
+ #define EVAL5(...) __VA_ARGS__
+
+ #define OVERLOAD___(F,_16,_15,_14,_13,_12,_11,_10,_9,_8,_7,_6,_5,_4,_3,_2,_1,n,...) F##_##n
+ #define OVERLOAD__(F, ...) OVERLOAD___(F,##__VA_ARGS__,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)
+ #define OVERLOAD_(...) DEFER(OVERLOAD__(__VA_ARGS__))
+ #define OVERLOAD(F, ...) OVERLOAD_(F,##__VA_ARGS__)(__VA_ARGS__)
+#endif
+
+#define GET(name) name##get
+#define GETTER(type, name) type GET(name)() { return name; }
+
+#define LAMBDA(...) { __VA_ARGS__ ; }
+
+// Can't wrap with do-while as block may contain continue or break
+#define WITH(type, name, value, block) { \
+ type __with_save = (name); \
+ name = (value); \
+ LAMBDA(block) \
+ name = __with_save; \
+} do { } while (0)
+
+#endif
#ifndef NIL_H
#define NIL_H
-#if QCC_SUPPORT_NIL
+#ifdef QCC_SUPPORT_NIL
#define func_null nil
#define string_null nil
#else
#ifndef OO_H
#define OO_H
+#include "misc.qh"
#include "nil.qh"
#ifdef MENUQC
#define class(name) [[class(name)]]
#define new(class) ((class) __spawn(#class, __FILE__, __LINE__))
#endif
+#define spawn() new(entity)
// Classes have a `spawn##cname(entity)` constructor
// The parameter is used across [[accumulate]] functions
--- /dev/null
+#ifndef SELF_H
+#define SELF_H
+
+// Transition from global 'self' to local 'this'
+
+[[alias("self")]] entity __self;
+
+// Step 1: auto oldself
+#if 1
+#define SELFPARAM() noref entity this = __self
+#define setself(s) (__self = s)
+#define self __self
+#endif
+
+// Step 2: check SELFPARAM() is present for functions that use self
+#if 0
+#define SELFPARAM() [[alias("__self")]] noref entity this = __self
+#define setself(s) (__self = s)
+#define self this
+#endif
+
+// Step 3: const self
+#if 0
+#define SELFPARAM() noref const entity this = __self
+entity setself(entity e) { return self = e; }
+entity getself() { return self; }
+#define self getself()
+#endif
+
+// Step 4: enable when possible
+// TODO: Remove SELFPARAM in favor of a parameter
+#if 0
+#define SELFPARAM() noref const entity this = __self
+#define self this
+#endif
+
+#endif
#ifndef TEST_H
#define TEST_H
-#include "../common/util.qh"
-
#define TEST_Check(cond) do { if(!(cond)) TEST_Fail(#cond); } while(0)
void TEST_OK();
#ifndef URLLIB_H
#define URLLIB_H
-#include "../common/util.qh"
-
// URI handles
const int URI_GET_DISCARD = 0;
const int URI_GET_IPBAN = 1;
#ifndef CLIENT_ALL_H
#define CLIENT_ALL_H
-#include "../dpdefs/menudefs.qh"
-#include "../dpdefs/keycodes.qh"
-
#endif
#ifndef ANIM_ANIMATION_H
#define ANIM_ANIMATION_H
-#include "../oo/base.qh"
void setterDummy(entity, float);
CLASS(Animation, Object)
METHOD(Animation, configureAnimation, void(entity, entity, void(entity, float), float, float, float, float));
#ifndef ANIM_ANIMHOST_H
#define ANIM_ANIMHOST_H
-#include "../oo/base.qh"
CLASS(AnimHost, Object)
METHOD(AnimHost, addAnim, void(entity, entity));
METHOD(AnimHost, removeAnim, void(entity, entity));
#ifndef ITEM_H
#define ITEM_H
#include "skin.qh"
-#include "oo/base.qh"
CLASS(Item, Object)
METHOD(Item, draw, void(entity));
METHOD(Item, keyDown, float(entity, float, float, float));
#include "draw.qh"
#include "skin.qh"
-#include "oo/base.qh"
-
#include "xonotic/util.qh"
#include "../common/constants.qh"
+++ /dev/null
-#ifndef BASE_H
-#define BASE_H
-
-#include "../../common/util.qh"
-#include "../../dpdefs/keycodes.qh"
-
-#define world NULL
-
-#endif
#ifndef CLASSES_H
#define CLASSES_H
-#include "base.qh"
#include "../classes.inc"
#define IMPLEMENTATION
-#include "../common/util-pre.qh"
-#include "../dpdefs/menudefs.qh"
-#include "../dpdefs/keycodes.qh"
-#include "../common/util-post.qh"
-
#include "../lib/_all.inc"
+#define world NULL
+
#include "oo/classes.qc"
#include "draw.qc"
#include "util.qh"
#include "../menu.qh"
-#include "../oo/base.qh"
#include "../../common/campaign_common.qh"
#include "../../common/constants.qh"
#include "../../common/mapinfo.qh"
#include "defs.qh"
#include "miscfunctions.qh"
-#include "../dpdefs/progsdefs.qh"
-#include "../dpdefs/dpextensions.qh"
#include "../common/models/all.qh"
#include "../common/sounds/all.qh"
#include "defs.qh"
#include "miscfunctions.qh"
-#include "../dpdefs/progsdefs.qh"
-#include "../dpdefs/dpextensions.qh"
#include "command/common.qh"
#if defined(CSQC)
#elif defined(MENUQC)
#elif defined(SVQC)
- #include "../dpdefs/progsdefs.qh"
- #include "../dpdefs/dpextensions.qh"
#include "../common/vehicles/all.qh"
#include "antilag.qh"
#endif
--- /dev/null
+#include "aim.qc"
+#include "bot.qc"
+#include "navigation.qc"
+#include "scripting.qc"
+#include "waypoints.qc"
+
+#include "havocbot/_all.inc"
#include "../../csqcmodellib/sv_model.qh"
-#include "../../dpdefs/dpextensions.qh"
-#include "../../dpdefs/progsdefs.qh"
-
#include "../../warpzonelib/common.qh"
#include "../../warpzonelib/util_server.qh"
--- /dev/null
+#include "havocbot.qc"
+#include "role_keyhunt.qc"
+#include "roles.qc"
#if defined(CSQC)
#elif defined(MENUQC)
#elif defined(SVQC)
- #include "../dpdefs/progsdefs.qh"
#include "../common/constants.qh"
#endif
#if defined(CSQC)
#elif defined(MENUQC)
#elif defined(SVQC)
- #include "../dpdefs/progsdefs.qh"
- #include "../dpdefs/dpextensions.qh"
#include "../warpzonelib/common.qh"
#include "../common/constants.qh"
#include "../common/teams.qh"
#include "../common/triggers/subs.qh"
-#include "../client/bgmscript.qh"
+entityclass(BGMScript);
+class(BGMScript) .string bgmscript;
+class(BGMScript) .float bgmscriptattack;
+class(BGMScript) .float bgmscriptdecay;
+class(BGMScript) .float bgmscriptsustain;
+class(BGMScript) .float bgmscriptrelease;
#include "../common/constants.qh"
#include "../csqcmodellib/sv_model.qh"
#include "defs.qh"
#include "../common/constants.qh"
#include "../common/util.qh"
-#include "../dpdefs/dpextensions.qh"
-#include "../dpdefs/progsdefs.qh"
/*
* Protocol of online ban list:
#if defined(CSQC)
#elif defined(MENUQC)
#elif defined(SVQC)
- #include "../../dpdefs/progsdefs.qh"
#include "mutators_include.qh"
#include "../../common/mapinfo.qh"
#endif
#if defined(CSQC)
#elif defined(MENUQC)
#elif defined(SVQC)
- #include "../../dpdefs/progsdefs.qh"
- #include "../../dpdefs/dpextensions.qh"
#include "../../warpzonelib/anglestransform.qh"
#include "../../warpzonelib/common.qh"
#include "../../warpzonelib/util_server.qh"
--- /dev/null
+#include "costs.qc"
+#include "expandnode.qc"
+#include "main.qc"
+#include "movenode.qc"
+#include "path_waypoint.qc"
+#include "utility.qc"
#if defined(CSQC)
#elif defined(MENUQC)
#elif defined(SVQC)
- #include "../dpdefs/progsdefs.qh"
- #include "../dpdefs/dpextensions.qh"
#include "defs.qh"
#include "playerdemo.qh"
#endif
-#include "../common/util-pre.qh"
-#include "sys-pre.qh"
-#include "../dpdefs/progsdefs.qh"
-#include "../dpdefs/dpextensions.qh"
-#include "sys-post.qh"
-#include "../common/util-post.qh"
-
#include "../lib/_all.inc"
#include "anticheat.qc"
#include "t_quake3.qc"
#include "t_quake.qc"
-#include "bot/aim.qc"
-#include "bot/bot.qc"
-#include "bot/navigation.qc"
-#include "bot/scripting.qc"
-#include "bot/waypoints.qc"
-
-#include "bot/havocbot/havocbot.qc"
-#include "bot/havocbot/role_keyhunt.qc"
-#include "bot/havocbot/roles.qc"
+#include "bot/_all.inc"
#include "command/all.qc"
#include "mutators/mutators_include.qc"
#include "mutators/mutators.qc"
-#include "pathlib/costs.qc"
-#include "pathlib/expandnode.qc"
-#include "pathlib/main.qc"
-#include "pathlib/movenode.qc"
-#include "pathlib/path_waypoint.qc"
-#include "pathlib/utility.qc"
+#include "pathlib/_all.inc"
#include "weapons/accuracy.qc"
#include "weapons/common.qc"
#if defined(CSQC)
#elif defined(MENUQC)
#elif defined(SVQC)
- #include "../dpdefs/progsdefs.qh"
- #include "../dpdefs/dpextensions.qh"
#endif
/**
#ifndef T_ITEMS_H
#define T_ITEMS_H
-// constants
-const int IT_UNLIMITED_WEAPON_AMMO = 1; // when this bit is set, using a weapon does not reduce ammo. Checkpoints can give this powerup.
-const int IT_UNLIMITED_SUPERWEAPONS = 2; // when this bit is set, superweapons don't expire. Checkpoints can give this powerup.
-const int IT_CTF_SHIELDED = 4; // set for the flag shield
-const int IT_USING_JETPACK = 8; // confirmation that button is pressed
-const int IT_JETPACK = 16; // actual item
-const int IT_FUEL_REGEN = 32; // fuel regeneration trigger
-// where is 64... ?
-const int IT_FUEL = 128;
-// -Wdouble-declaration
-#define IT_SHELLS 256
-// -Wdouble-declaration
-#define IT_NAILS 512
-// -Wdouble-declaration
-#define IT_ROCKETS 1024
-// -Wdouble-declaration
-#define IT_CELLS 2048
-const int IT_SUPERWEAPON = 4096;
-const int IT_STRENGTH = 8192;
-const int IT_INVINCIBLE = 16384;
-const int IT_HEALTH = 32768;
-const int IT_PLASMA = 65536;
-
-// shared value space (union):
- // for items:
- // -Wdouble-declaration
- #define IT_KEY1 131072
- // -Wdouble-declaration
- #define IT_KEY2 262144
-// end
-
-const int IT_5HP = 524288;
-const int IT_25HP = 1048576;
-const int IT_ARMOR_SHARD = 2097152;
-const int IT_ARMOR = 4194304;
-
-// item masks
-const int IT_AMMO = 3968; // IT_FUEL | IT_SHELLS | IT_NAILS | IT_ROCKETS | IT_CELLS | IT_PLASMA;
-const int IT_PICKUPMASK = 51; // IT_FUEL_REGEN | IT_JETPACK | IT_UNLIMITED_AMMO; // strength and invincible are handled separately
-const int IT_UNLIMITED_AMMO = 3; // IT_UNLIMITED_SUPERWEAPONS | IT_UNLIMITED_WEAPON_AMMO;
-
const int AMMO_COUNT = 4; // amount of ammo types to show in the inventory panel
// item networking
cd ..
declare -a NOWARN=(
- '-Wno-field-redeclared'
- '-Wno-unused-variable'
- '-Wno-implicit-function-pointer'
+ -Wno-field-redeclared
+ -Wno-unused-variable
+ -Wno-implicit-function-pointer
)
declare -a FEATURES=(
- '-DVEHICLES_ENABLED=1'
- '-DVEHICLES_USE_ODE=0'
+ -DVEHICLES_ENABLED=1
+ -DVEHICLES_USE_ODE=0
)
declare QCC=../../../gmqcc/gmqcc
+declare -a QCC_FLAGS=(
+ -std=gmqcc
+ -Wall -Werror
+ -fftepp -fftepp-predefs -Wcpp
+ -futf8
+ -freturn-assignments
+ -frelaxed-switch
+ -O3
+)
+
function check() {
- declare -l base="$1"
- declare -la predefs=("${!2}")
- find "$base" -type f -name '*.qc' -print0 | sort -z | while IFS= read -r -d '' file; do
+ declare -l base="${1}"
+ declare -la predefs=("-D${2}" "lib/_all.inc")
+ find "$base" -type f -name '*.qc' -print0 | sort -z | while read -r -d '' file; do
echo "$file"
- ${QCC} -std=gmqcc -fftepp -fftepp-predefs -Werror -Wall "${NOWARN[@]}" "${FEATURES[@]}" -futf8 -O3 "${predefs[@]}" "$file" >/dev/null
+ ${QCC} "${QCC_FLAGS[@]}" "${NOWARN[@]}" "${FEATURES[@]}" "${predefs[@]}" "$file" >/dev/null
done
}
-clientdefs=("-DCSQC" "common/util-pre.qh" "dpdefs/csprogsdefs.qh")
-check "client" clientdefs[@]
-
-serverdefs=("-DSVQC" "common/util-pre.qh" "server/sys-pre.qh" "dpdefs/progsdefs.qh" "dpdefs/dpextensions.qh" "server/sys-post.qh" "server/defs.qh" "server/autocvars.qh")
-check "server" serverdefs[@]
-
-menudefs=("-DMENUQC" "common/util-pre.qh" "dpdefs/menudefs.qh")
-check "menu" menudefs[@]
+check client CSQC
+check server SVQC
+check menu MENUQC
#include "anglestransform.qh"
#if defined(CSQC)
- #include "../dpdefs/csprogsdefs.qh"
#elif defined(MENUQC)
#elif defined(SVQC)
- #include "../dpdefs/progsdefs.qh"
- #include "../dpdefs/dpextensions.qh"
#endif
#ifdef POSITIVE_PITCH_IS_DOWN
#if defined(CSQC)
#include "../client/autocvars.qh"
#include "../csqcmodellib/cl_model.qh"
- #include "../dpdefs/csprogsdefs.qh"
#elif defined(MENUQC)
#elif defined(SVQC)
#endif
#include "common.qh"
#if defined(CSQC)
- #include "../dpdefs/csprogsdefs.qh"
#include "../server/t_items.qh"
#elif defined(MENUQC)
#elif defined(SVQC)
#include "../common/weapons/all.qh"
- #include "../dpdefs/dpextensions.qh"
- #include "../dpdefs/progsdefs.qh"
#endif
void WarpZone_Accumulator_Clear(entity acc)
#include "mathlib.qh"
#if defined(CSQC)
- #include "../dpdefs/csprogsdefs.qh"
#elif defined(MENUQC)
#elif defined(SVQC)
- #include "../dpdefs/dpextensions.qh"
- #include "../dpdefs/progsdefs.qh"
#endif
int fpclassify(float x)
#include "../common/constants.qh"
#include "../common/triggers/subs.qh"
#include "../common/util.qh"
- #include "../dpdefs/dpextensions.qh"
- #include "../dpdefs/progsdefs.qh"
#include "../server/command/common.qh"
#include "../server/constants.qh"
#include "../server/defs.qh"
#elif defined(MENUQC)
#elif defined(SVQC)
#include "../csqcmodellib/sv_model.qh"
- #include "../dpdefs/dpextensions.qh"
- #include "../dpdefs/progsdefs.qh"
#endif
#include "common.qh"