X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Flib%2Fspawnfunc.qh;h=d254364cefe2d38a4ecd228183d8d65a3043508d;hb=c4af92836f8ae6cc0d4bfe0c841f264b1ff2eac7;hp=bcc1f2c693fdc7a14b07f54fbff14f62f36c8c34;hpb=cbb0a16ac5554caedc4af3d81ff857c40eb9bdb9;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/lib/spawnfunc.qh b/qcsrc/lib/spawnfunc.qh index bcc1f2c69..d254364ce 100644 --- a/qcsrc/lib/spawnfunc.qh +++ b/qcsrc/lib/spawnfunc.qh @@ -6,6 +6,8 @@ /** If this global exists, only functions with spawnfunc_ name prefix qualify as spawn functions */ noref bool require_spawnfunc_prefix; .bool spawnfunc_checked; +/** Not for production use, provides access to a dump of the entity's fields when it is parsed from map data */ +//noref string __fullspawndata; // Optional type checking; increases compile time too much to be enabled by default #if 0 @@ -146,6 +148,7 @@ noref bool require_spawnfunc_prefix; FIELD_SCALAR(fld, health) \ FIELD_SCALAR(fld, height) \ FIELD_SCALAR(fld, impulse) \ + FIELD_SCALAR(fld, invincible_finished) \ FIELD_SCALAR(fld, item_pickupsound) \ FIELD_SCALAR(fld, killtarget) \ FIELD_SCALAR(fld, lerpfrac) \ @@ -178,6 +181,7 @@ noref bool require_spawnfunc_prefix; FIELD_SCALAR(fld, phase) \ FIELD_SCALAR(fld, platmovetype) \ FIELD_SCALAR(fld, race_place) \ + FIELD_SCALAR(fld, strength_finished) \ FIELD_SCALAR(fld, radius) \ FIELD_SCALAR(fld, respawntimestart) \ FIELD_SCALAR(fld, respawntimejitter) \ @@ -273,11 +277,15 @@ noref bool __spawnfunc_first; if (!this.sourceLoc) { \ this.sourceLoc = __FILE__":"STR(__LINE__); \ } \ + this.classname = #id; \ if (!this.spawnfunc_checked) { \ _checkWhitelisted(this, #id); \ this.spawnfunc_checked = true; \ if (this) { \ /* not worldspawn, delay spawn */ \ + /* clear some dangerous fields (TODO: properly support these in the map!) */ \ + this.think = func_null; \ + this.nextthink = 0; \ __spawnfunc_defer(this, __spawnfunc_##id); \ } else { \ /* world might not be "worldspawn" */ \