X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;ds=sidebyside;f=qcsrc%2Flib%2F_all.inc;h=ab74531605f29a44d7f69c23b7ba99e4f30a3479;hb=307166f4a88c095e499ec172390ae4ebe2656023;hp=d8f07455a28c7766065c6b6e0737020a4758a5e4;hpb=2183056a5b6e75d2e025aa6c718eeb6f87de31b6;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/lib/_all.inc b/qcsrc/lib/_all.inc index d8f07455a..ab7453160 100644 --- a/qcsrc/lib/_all.inc +++ b/qcsrc/lib/_all.inc @@ -24,12 +24,26 @@ #define bool float #endif +#ifndef QCC_SUPPORT_ACCUMULATE + #warning "QCC does not support accumulate, may not compile correctly" + #define ACCUMULATE +#else + #define ACCUMULATE [[accumulate]] +#endif + #ifndef QCC_SUPPORT_ERASEABLE #define ERASEABLE #else #define ERASEABLE [[eraseable]] #endif +#ifndef QCC_SUPPORT_ALIAS + #warning "QCC does not support alias, may not compile correctly" + #define ALIAS(var) +#else + #define ALIAS(var) [[alias(var)]] +#endif + #include #if defined(CSQC) @@ -47,6 +61,12 @@ #include +#ifndef QCC_SUPPORT_POW + #define pow(a, b) pow(a, b) +#else + #define pow(a, b) ((a) ** (b)) +#endif + #include "self.qh" #define USING(name, T) typedef T name @@ -113,6 +133,7 @@ #include "oo.qh" #include "p2mathlib.qc" #include "progname.qh" +#include "promise.qc" #include "random.qc" #include "registry.qh" #include "registry_net.qh" @@ -141,14 +162,14 @@ void make_safe_for_remove(entity this); #define objerror_safe(e) make_safe_for_remove(e) #endif -#define objerror(this, msg) MACRO_BEGIN { \ +#define objerror(this, msg) MACRO_BEGIN \ LOG_WARN("======OBJECT ERROR======"); \ entity _e = (this); \ eprint(_e); \ objerror_safe(_e); \ delete(_e); \ LOG_WARNF("%s OBJECT ERROR in %s:\n%s\nTip: read above for entity information", PROGNAME, __FUNC__, msg); \ -} MACRO_END +MACRO_END #ifdef MENUQC void _m_init(); @@ -182,7 +203,17 @@ void make_safe_for_remove(entity this); #define SV_Shutdown _SV_Shutdown void _StartFrame(); - void StartFrame() { if (_StartFrame) _StartFrame(); } + bool _StartFrame_init; + void spawnfunc_worldspawn(entity); + void StartFrame() { + if (!_StartFrame_init) { + _StartFrame_init = true; + float oldtime = time; time = 1; + __spawnfunc_expecting = 2; NULL.__spawnfunc_constructor(NULL); + time = oldtime; + } + if (_StartFrame) _StartFrame(); + } #define StartFrame _StartFrame void _SetNewParms(); @@ -231,7 +262,8 @@ void make_safe_for_remove(entity this); void SV_OnEntityPreSpawnFunction() { ENGINE_EVENT(); - if (_SV_OnEntityPreSpawnFunction) _SV_OnEntityPreSpawnFunction(this); + __spawnfunc_expecting = true; + __spawnfunc_expect = this; } #define SV_OnEntityPreSpawnFunction _SV_OnEntityPreSpawnFunction @@ -250,13 +282,7 @@ void make_safe_for_remove(entity this); #ifdef CSQC void _CSQC_Init(); - void CSQC_Init() - { - static_init(); - static_init_late(); - static_init_precache(); - if (_CSQC_Init) _CSQC_Init(); - } + void CSQC_Init() { if (_CSQC_Init) _CSQC_Init(); } #define CSQC_Init _CSQC_Init void _CSQC_Shutdown();