]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Remove map entity whitelist checks
authorLegendaryGuard <rootuser999@gmail.com>
Sat, 27 May 2023 10:32:22 +0000 (10:32 +0000)
committerLegendaryGuard <rootuser999@gmail.com>
Sat, 27 May 2023 10:32:22 +0000 (10:32 +0000)
qcsrc/Makefile
qcsrc/lib/spawnfunc.qh
qcsrc/tools/compilationunits.sh

index f0ebdf881e03fa79d1945162db98c13274692e80..ee9e7e64ab9c6e6016fd362b3e2faca5a801b369 100644 (file)
@@ -11,7 +11,6 @@ XONOTIC ?= 1
 ENABLE_EFFECTINFO ?= 0
 ENABLE_DEBUGDRAW ?= 0
 ENABLE_DEBUGTRACE ?= 0
-SPAWNFUNC_CHECK_FIELDS ?= 1
 BUILD_MOD ?=
 
 ifndef ZIP
@@ -45,7 +44,6 @@ QCCDEFS ?= \
        -DENABLE_EFFECTINFO=$(ENABLE_EFFECTINFO) \
        -DENABLE_DEBUGDRAW=$(ENABLE_DEBUGDRAW) \
        -DENABLE_DEBUGTRACE=$(ENABLE_DEBUGTRACE) \
-       -DSPAWNFUNC_CHECK_FIELDS=$(SPAWNFUNC_CHECK_FIELDS) \
        $(if $(BUILD_MOD), -DBUILD_MOD="$(BUILD_MOD)" -I$(BUILD_MOD), ) \
        $(QCCDEFS_EXTRA)
 
index 8e226b39138d631a54043d001f11ce8b13a0af02..9f1a1ceeacd22ac29de5fe4c6c123c615185c2aa 100644 (file)
@@ -87,187 +87,6 @@ noref string __fullspawndata;
         e.__spawnfunc_constructor(e);
     }
 
-// enables/disables warnings if a map entity has a field that doesn't exist
-// useful for debugging and compatibility testing
-#if SPAWNFUNC_CHECK_FIELDS
-
-       #define FIELD_SCALAR(fld, n) \
-               fld(n)
-       #define FIELD_VEC(fld, n) \
-               fld(n) \
-               fld(n##_x) \
-               fld(n##_y) \
-               fld(n##_z)
-
-       #define FIELDS_NONE(fld)
-       #define FIELDS_ALL(fld) if (false)
-
-       #define FIELDS_COMMON(fld) \
-               FIELD_SCALAR(fld, classname) \
-               FIELD_SCALAR(fld, sourceLoc) \
-               FIELD_SCALAR(fld, spawnfunc_checked) \
-               FIELD_VEC(fld, origin) \
-               /**/
-
-       #define FIELDS_UNION(fld) \
-               FIELD_SCALAR(fld, Version) \
-               FIELD_SCALAR(fld, ammo_cells) \
-               FIELD_SCALAR(fld, ammo_nails) \
-               FIELD_SCALAR(fld, ammo_rockets) \
-               FIELD_SCALAR(fld, antiwall_flag) \
-               FIELD_SCALAR(fld, armorvalue) \
-               FIELD_SCALAR(fld, atten) \
-               FIELD_SCALAR(fld, bgmscriptdecay) \
-               FIELD_SCALAR(fld, bgmscriptsustain) \
-               FIELD_SCALAR(fld, bgmscript) \
-               FIELD_SCALAR(fld, button0) \
-               FIELD_SCALAR(fld, chmap) \
-               FIELD_SCALAR(fld, cnt) \
-               FIELD_SCALAR(fld, colormap) \
-               FIELD_SCALAR(fld, count) \
-               FIELD_SCALAR(fld, curvetarget) \
-               FIELD_SCALAR(fld, cvarfilter) \
-               FIELD_SCALAR(fld, debrisdamageforcescale) \
-               FIELD_SCALAR(fld, debrisfadetime) \
-               FIELD_SCALAR(fld, debrismovetype) \
-               FIELD_SCALAR(fld, debrisskin) \
-               FIELD_SCALAR(fld, debristimejitter) \
-               FIELD_SCALAR(fld, debristime) \
-               FIELD_SCALAR(fld, debris) \
-               FIELD_SCALAR(fld, delay) \
-               FIELD_SCALAR(fld, dmgtime) \
-               FIELD_SCALAR(fld, dmg) \
-               FIELD_SCALAR(fld, dmg_edge) \
-               FIELD_SCALAR(fld, dmg_force) \
-               FIELD_SCALAR(fld, dmg_radius) \
-               FIELD_SCALAR(fld, effects) \
-               FIELD_SCALAR(fld, falloff) \
-               FIELD_SCALAR(fld, flags) \
-               FIELD_SCALAR(fld, fog) \
-               FIELD_SCALAR(fld, frags) \
-               FIELD_SCALAR(fld, frame) \
-               FIELD_SCALAR(fld, gametype) \
-               FIELD_SCALAR(fld, gametypefilter) \
-               FIELD_SCALAR(fld, geomtype) \
-               FIELD_SCALAR(fld, gravity) \
-               FIELD_SCALAR(fld, health) \
-               FIELD_SCALAR(fld, height) \
-               FIELD_SCALAR(fld, impulse) \
-               FIELD_SCALAR(fld, invincible_finished) \
-               FIELD_SCALAR(fld, invisibility_finished) \
-               FIELD_SCALAR(fld, item_pickupsound) \
-               FIELD_SCALAR(fld, killtarget) \
-               FIELD_SCALAR(fld, lerpfrac) \
-               FIELD_SCALAR(fld, light_lev) \
-               FIELD_SCALAR(fld, lip) \
-               FIELD_SCALAR(fld, loddistance1) \
-               FIELD_SCALAR(fld, lodmodel1) \
-               FIELD_SCALAR(fld, lodmodel2) \
-               FIELD_SCALAR(fld, ltime) \
-               FIELD_SCALAR(fld, map) \
-               FIELD_SCALAR(fld, max_health) \
-               FIELD_SCALAR(fld, mdl) \
-               FIELD_SCALAR(fld, message2) \
-               FIELD_SCALAR(fld, message) \
-               FIELD_SCALAR(fld, modelindex) \
-               FIELD_SCALAR(fld, modelscale) \
-               FIELD_SCALAR(fld, model) \
-               FIELD_SCALAR(fld, monsterid) \
-               FIELD_SCALAR(fld, monster_moveflags) \
-               FIELD_SCALAR(fld, monster_name) \
-               FIELD_SCALAR(fld, movetype) \
-               FIELD_SCALAR(fld, move_movetype) \
-               FIELD_SCALAR(fld, music) \
-               FIELD_SCALAR(fld, netname) \
-               FIELD_SCALAR(fld, nextthink) \
-               FIELD_SCALAR(fld, noalign) \
-               FIELD_SCALAR(fld, noise1) \
-               FIELD_SCALAR(fld, noise2) \
-               FIELD_SCALAR(fld, noise3) \
-               FIELD_SCALAR(fld, noise) \
-               FIELD_SCALAR(fld, notcpm) \
-               FIELD_SCALAR(fld, notfree) \
-               FIELD_SCALAR(fld, notsingle) \
-               FIELD_SCALAR(fld, notta) \
-               FIELD_SCALAR(fld, notteam) \
-               FIELD_SCALAR(fld, notvq3) \
-               FIELD_SCALAR(fld, phase) \
-               FIELD_SCALAR(fld, platmovetype) \
-               FIELD_SCALAR(fld, race_place) \
-               FIELD_SCALAR(fld, speed_finished) \
-               FIELD_SCALAR(fld, strength_finished) \
-               FIELD_SCALAR(fld, radius) \
-               FIELD_SCALAR(fld, respawntimestart) \
-               FIELD_SCALAR(fld, respawntimejitter) \
-               FIELD_SCALAR(fld, respawntime) \
-               FIELD_SCALAR(fld, restriction) \
-               FIELD_SCALAR(fld, scale) \
-               FIELD_SCALAR(fld, skin) \
-               FIELD_SCALAR(fld, solid) \
-               FIELD_SCALAR(fld, sound1) \
-               FIELD_SCALAR(fld, sounds) \
-               FIELD_SCALAR(fld, spawnflags) \
-               FIELD_SCALAR(fld, spawnmob) \
-               FIELD_SCALAR(fld, speed) \
-               FIELD_SCALAR(fld, strength) \
-               FIELD_SCALAR(fld, style) \
-               FIELD_SCALAR(fld, target2) \
-               FIELD_SCALAR(fld, target3) \
-               FIELD_SCALAR(fld, target4) \
-               FIELD_SCALAR(fld, targetname) \
-               FIELD_SCALAR(fld, target) \
-               FIELD_SCALAR(fld, target_random) \
-               FIELD_SCALAR(fld, target_range) \
-               FIELD_SCALAR(fld, team) \
-               FIELD_SCALAR(fld, trigger_reverse) \
-               FIELD_SCALAR(fld, turret_scale_aim) \
-               FIELD_SCALAR(fld, turret_scale_ammo) \
-               FIELD_SCALAR(fld, turret_scale_damage) \
-               FIELD_SCALAR(fld, turret_scale_health) \
-               FIELD_SCALAR(fld, turret_scale_range) \
-               FIELD_SCALAR(fld, turret_scale_refire) \
-               FIELD_SCALAR(fld, turret_scale_respawn) \
-               FIELD_SCALAR(fld, volume) \
-               FIELD_SCALAR(fld, wait) \
-               FIELD_SCALAR(fld, warpzone_fadeend) \
-               FIELD_SCALAR(fld, warpzone_fadestart) \
-               FIELD_SCALAR(fld, weapon) \
-               FIELD_SCALAR(fld, worldtype) \
-               FIELD_VEC(fld, absmax) \
-               FIELD_VEC(fld, absmin) \
-               FIELD_VEC(fld, angles) \
-               FIELD_VEC(fld, avelocity) \
-               FIELD_VEC(fld, beam_color)\
-               FIELD_VEC(fld, debrisavelocityjitter) \
-               FIELD_VEC(fld, debrisvelocity) \
-               FIELD_VEC(fld, debrisvelocityjitter) \
-               FIELD_VEC(fld, color) \
-               FIELD_VEC(fld, mangle) \
-               FIELD_VEC(fld, maxs) \
-               FIELD_VEC(fld, mins) \
-               FIELD_VEC(fld, modelscale_vec) \
-               FIELD_VEC(fld, velocity) \
-               /**/
-#endif
-
-ERASEABLE
-void _checkWhitelisted(entity this, string id)
-{
-#if SPAWNFUNC_CHECK_FIELDS
-       for (int i = 0, n = numentityfields(); i < n; ++i)
-       {
-               string value = getentityfieldstring(i, this);
-               string s = entityfieldname(i);
-               FIELDS_UNION(_spawnfunc_checktypes)
-               if (value == "") continue;
-               if (s == "") continue;
-               FIELDS_COMMON(_spawnfunc_check)
-               FIELDS_UNION(_spawnfunc_check)
-               LOG_WARNF(_("Entity field %s.%s (%s) is not whitelisted. If you believe this is an error, please file an issue."), id, s, value);
-       }
-#endif
-}
-
 // this function simply avoids expanding IL_NEW during compilation
 // for each spawning entity
 void g_spawn_queue_spawn() { g_spawn_queue = IL_NEW(); }
@@ -300,7 +119,6 @@ noref bool __spawnfunc_first;
                } \
                this.classname = #id; \
                if (!this.spawnfunc_checked) { \
-                       _checkWhitelisted(this, #id); \
                        if (__fullspawndata) { \
                                /* not supported in old DP */ \
                                /* must be read inside the real spawnfunc */ \
index fa08cdcaad43f577ec3321fc9d7765357ce7d921..d13cb6e091e8f2dd9e350f78e25fc30f7de33d35 100755 (executable)
@@ -34,7 +34,6 @@ declare -a QCCDEFS=(
     -DENABLE_EFFECTINFO=0
     -DENABLE_DEBUGDRAW=0
     -DENABLE_DEBUGTRACE=0
-    -DSPAWNFUNC_CHECK_FIELDS=1
 )
 QCCDEFS="${QCCDEFS[@]}"