X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Flib%2Foo.qh;h=a2cef664bad3b72f9936ab371b12087c1e362027;hb=4e21f418ad9e6287efb942c1fa2861a51981110a;hp=b22ff791501c9a990c93e5d9c7f3dabc2c35f661;hpb=ec98f5c9d50f267779fed871c9eb094a52064219;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/lib/oo.qh b/qcsrc/lib/oo.qh index b22ff7915..a2cef664b 100644 --- a/qcsrc/lib/oo.qh +++ b/qcsrc/lib/oo.qh @@ -39,12 +39,6 @@ entity __spawn(string _classname, string _sourceLoc, bool pure) this.sourceLoc = _sourceLoc; if (pure) { make_pure(this); - #ifdef CSQC - setorigin(this, (world.mins + world.maxs) * 0.5); - #endif - #ifdef SVQC - setorigin(this, (world.mins + world.maxs) * 0.5); - #endif } return this; } @@ -56,11 +50,11 @@ entity __spawn(string _classname, string _sourceLoc, bool pure) #ifndef QCC_SUPPORT_ENTITYCLASS #define entityclass_2(name, base) USING(name, entity) #define classfield(name) - #define _new(class, pure) __spawn( #class, __FILE__ ":" STR(__LINE__), pure) + #define _new(class, pure) __spawn(#class, __FILE__ ":" STR(__LINE__), pure) #else #define entityclass_2(name, base) entityclass name : base {} #define classfield(name) [[class(name)]] - #define _new(class, pure) ((class) __spawn( #class, __FILE__ ":" STR(__LINE__), pure)) + #define _new(class, pure) ((class) __spawn(#class, __FILE__ ":" STR(__LINE__), pure)) #endif /** entities you care about seeing (.origin works) */ #define new(class) _new(class, false) @@ -75,13 +69,13 @@ ACCUMULATE void ONREMOVE(entity this) {} #endif .void(entity this) dtor; -#define delete(this) MACRO_BEGIN { \ +#define delete(this) MACRO_BEGIN \ entity _this = (this); \ void(entity) _dtor = _this.dtor; \ ONREMOVE(this); \ if (_dtor) _dtor(_this); else delete_fn(_this); \ /* this = NULL; */ \ -} MACRO_END +MACRO_END entity _clearentity_ent; STATIC_INIT(clearentity) @@ -326,9 +320,9 @@ CLASS(Object) #define remove(this) delete(this) METHOD(Object, describe, string(Object this)) { - TC(Object, this); + TC(Object, this); string s = _("No description"); - if (cvar("developer")) + if (cvar("developer") > 0) { for (int i = 0, n = numentityfields(); i < n; ++i) { @@ -340,7 +334,7 @@ CLASS(Object) } METHOD(Object, display, void(Object this, void(string name, string icon) returns)) { - TC(Object, this); + TC(Object, this); returns(sprintf("entity %i", this), "nopreview_map"); } ENDCLASS(Object)