]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
cpp compat
authorTimePath <andrew.hardaker1995@gmail.com>
Tue, 29 Dec 2015 08:13:35 +0000 (19:13 +1100)
committerTimePath <andrew.hardaker1995@gmail.com>
Tue, 29 Dec 2015 08:13:35 +0000 (19:13 +1100)
37 files changed:
qcsrc/client/hud/hud.qc
qcsrc/client/hud/hud.qh
qcsrc/common/constants.qh
qcsrc/common/csqcmodel_settings.qh
qcsrc/common/effects/qc/gibs.qc
qcsrc/common/ent_cs.qh
qcsrc/common/gamemodes/gamemode/onslaught/onslaught.qc
qcsrc/common/mutators/base.qh
qcsrc/common/mutators/events.qh
qcsrc/common/mutators/mutator/spawn_near_teammate/spawn_near_teammate.qc
qcsrc/common/physics/player.qc
qcsrc/common/triggers/trigger/jumppads.qc
qcsrc/common/vehicles/sv_vehicles.qc
qcsrc/common/vehicles/vehicle/bumblebee.qc
qcsrc/common/weapons/all.qh
qcsrc/common/weapons/weapon/porto.qc
qcsrc/lib/csqcmodel/cl_player.qc
qcsrc/lib/csqcmodel/settings.qh
qcsrc/lib/csqcmodel/sv_model.qc
qcsrc/lib/cvar.qh
qcsrc/lib/linkedlist.qh
qcsrc/lib/oo.qh
qcsrc/lib/registry.qh
qcsrc/lib/replicate.qh
qcsrc/lib/spawnfunc.qh
qcsrc/lib/stats.qh
qcsrc/server/bot/havocbot/havocbot.qc
qcsrc/server/bot/navigation.qc
qcsrc/server/bot/waypoints.qc
qcsrc/server/cheats.qc
qcsrc/server/cl_client.qc
qcsrc/server/cl_impulse.qc
qcsrc/server/command/sv_cmd.qc
qcsrc/server/g_world.qc
qcsrc/server/mutators/mutator/gamemode_keyhunt.qc
qcsrc/server/portals.qc
qcsrc/server/race.qc

index 920ee1ebd163ae271d12e0cc52d966e8ea634581..8d4759b1e98c96fcf4b80781aa101d4fc2a067b8 100644 (file)
@@ -1,18 +1,18 @@
 #include "hud.qh"
 
 #include "hud_config.qh"
-#include "mapvoting.qh"
-#include "scoreboard.qh"
-#include "teamradar.qh"
-#include "../common/t_items.qh"
-#include "../common/deathtypes/all.qh"
-#include "../common/items/all.qc"
-#include "../common/mapinfo.qh"
-#include "../common/mutators/mutator/waypoints/all.qh"
-#include "../common/stats.qh"
-#include "../lib/csqcmodel/cl_player.qh"
+#include "../mapvoting.qh"
+#include "../scoreboard.qh"
+#include "../teamradar.qh"
+#include "../../common/t_items.qh"
+#include "../../common/deathtypes/all.qh"
+#include "../../common/items/all.qc"
+#include "../../common/mapinfo.qh"
+#include "../../common/mutators/mutator/waypoints/all.qh"
+#include "../../common/stats.qh"
+#include "../../lib/csqcmodel/cl_player.qh"
 // TODO: remove
-#include "../server/mutators/mutator/gamemode_ctf.qc"
+#include "../../server/mutators/mutator/gamemode_ctf.qc"
 
 
 /*
index 7baed9e91af89a7faac1a9589210f7d14f1e229d..363324252aae1ad12c0a966d3c1e60b9f335b642 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef CLIENT_HUD_H
 #define CLIENT_HUD_H
 
-#include "../common/weapons/all.qh"
+#include "../../common/weapons/all.qh"
 
 bool HUD_Radar_Clickable();
 void HUD_Radar_Mouse();
index 96368bd15d2901f6d141d5e499bb15fad5fbe5e8..4bffd04baa2e9983091f42b198d980678f87063b 100644 (file)
@@ -237,14 +237,6 @@ vector autocvar_sv_player_crouch_viewoffset = '0 0 20';
 vector autocvar_sv_player_headsize = '24 24 12';
 
 
-// not so constant
-#define PL_VIEW_OFS STAT(PL_VIEW_OFS, NULL)
-#define PL_CROUCH_VIEW_OFS STAT(PL_CROUCH_VIEW_OFS, NULL)
-#define PL_MIN STAT(PL_MIN, NULL)
-#define PL_CROUCH_MIN STAT(PL_CROUCH_MIN, NULL)
-#define PL_MAX STAT(PL_MAX, NULL)
-#define PL_CROUCH_MAX STAT(PL_CROUCH_MAX, NULL)
-
 // a bit more constant
 const vector PL_MAX_CONST = '16 16 45';
 const vector PL_MIN_CONST = '-16 -16 -24';
index 9f9fa43f30f8ec2363fce01e214345dfa5aa0abc..c4b88cc95d2d7f22019ec7ca82f38ef73ad65532 100644 (file)
@@ -81,9 +81,9 @@
 #define CSQCPLAYER_HOOK_POSTCAMERASETUP() \
        CSQCPlayer_SetViewLocation()
 
-// force updates of player entities that often even if unchanged
+// force updates of player entities this frequently (per second) even if unchanged
 #ifndef CSQCPLAYER_FORCE_UPDATES
-#define CSQCPLAYER_FORCE_UPDATES 0.25
+#define CSQCPLAYER_FORCE_UPDATES 4
 #endif
 
 // mod must define:
index 2e54f43960d5d0f4284c35aa6afb0e462078fcda..2e01a507fa258ae11a2a9da65261a05dfc5bade9 100644 (file)
@@ -59,7 +59,7 @@ void Violence_GibSplash(entity source, float type, float amount, entity attacker
 .bool silent;
 
 #include "rubble.qh"
-#include "../common/physics/movetypes/movetypes.qh"
+#include "../../physics/movetypes/movetypes.qh"
 
 .float scale;
 .float alpha;
index 389aadc1fd9283d1301f635d9d6f0dc93fc8b42f..0d02e4b538e3f789981118358500052609b3399e 100644 (file)
@@ -50,7 +50,8 @@ REGISTER_NET_TEMP(CLIENT_ENTCS)
        {
                AL_DELETE(_entcs);
        }
-       #define entcs_receiver(...) EVAL(OVERLOAD(entcs_receiver, __VA_ARGS__))
+       #define entcs_receiver(...) EVAL_entcs_receiver(OVERLOAD(entcs_receiver, __VA_ARGS__))
+       #define EVAL_entcs_receiver(...) __VA_ARGS__
        #define entcs_receiver_1(i) AL_gete(_entcs, i)
        #define entcs_receiver_2(i, v) AL_sete(_entcs, i, v)
        #define entcs_is_self(e) ((e).sv_entnum == player_localentnum - 1)
index bcb729dc83e0f3a84ed1b2d0dba8fab33692d748..64192cbcd1bffc87ef7f1924e7dec866aa47ac29 100644 (file)
@@ -1751,7 +1751,7 @@ bool ons_Teleport(entity player, entity tele_target, float range, bool tele_effe
 
                loc += tele_target.origin + '0 0 128' * iteration_scale;
 
-               tracebox(loc, PL_MIN, PL_MAX, loc, MOVE_NORMAL, player);
+               tracebox(loc, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), loc, MOVE_NORMAL, player);
                if(trace_fraction == 1.0 && !trace_startsolid)
                {
                        traceline(tele_target.origin, loc, MOVE_NOMONSTERS, tele_target); // double check to make sure we're not spawning outside the world
@@ -1865,7 +1865,7 @@ MUTATOR_HOOKFUNCTION(ons, PlayerSpawn)
                                iteration_scale -= i / 10;
                                loc = closest_target.origin + '0 0 96' * iteration_scale;
                                loc += ('0 1 0' * random()) * 128 * iteration_scale;
-                               tracebox(loc, PL_MIN, PL_MAX, loc, MOVE_NORMAL, self);
+                               tracebox(loc, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), loc, MOVE_NORMAL, self);
                                if(trace_fraction == 1.0 && !trace_startsolid)
                                {
                                        traceline(closest_target.origin, loc, MOVE_NOMONSTERS, closest_target); // double check to make sure we're not spawning outside the world
@@ -1916,7 +1916,7 @@ MUTATOR_HOOKFUNCTION(ons, PlayerSpawn)
                                iteration_scale -= i / 10;
                                loc = closest_target.origin + '0 0 128' * iteration_scale;
                                loc += ('0 1 0' * random()) * 256 * iteration_scale;
-                               tracebox(loc, PL_MIN, PL_MAX, loc, MOVE_NORMAL, self);
+                               tracebox(loc, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), loc, MOVE_NORMAL, self);
                                if(trace_fraction == 1.0 && !trace_startsolid)
                                {
                                        traceline(closest_target.origin, loc, MOVE_NOMONSTERS, closest_target); // double check to make sure we're not spawning outside the world
index 6e06e5590943b0c5a7619b96d46a5fcfa8876181..d4a9526191c3bd35852d731b398210b25b936e18 100644 (file)
@@ -289,7 +289,8 @@ STATIC_INIT_LATE(Mutators) {
     [[accumulate]] void RegisterCallbacks() { CALLBACK_##name = NEW(Callback, func); }
 
 #define MUTATOR_HOOKFUNCTION(...) \
-    EVAL(OVERLOAD(MUTATOR_HOOKFUNCTION, __VA_ARGS__))
+    EVAL_MUTATOR_HOOKFUNCTION(OVERLOAD(MUTATOR_HOOKFUNCTION, __VA_ARGS__))
+#define EVAL_MUTATOR_HOOKFUNCTION(...) __VA_ARGS__
 
 #define MUTATOR_HOOKFUNCTION_2(mut, cb) \
     MUTATOR_HOOKFUNCTION_3(mut, cb, CBC_ORDER_ANY)
index 5cb5b4745a5705657053ca6c6ce940072e0c68d6..1258b6ff8b2d4a2082bf246e74cf3f9adebe7330 100644 (file)
@@ -16,7 +16,7 @@ string ret_string;
     /**/
 
 #define MUTATOR_ARGV(x, type) MUTATOR_ARGV_##x##_##type
-#define MUTATOR_NEWGLOBAL(x, type) type MUTATOR_ARGV(x, type);
+#define MUTATOR_NEWGLOBAL(x, type) type MUTATOR_ARGV_##x##_##type;
 
 MUTATOR_TYPES(MUTATOR_NEWGLOBAL, 0)
 MUTATOR_TYPES(MUTATOR_NEWGLOBAL, 1)
index dbbadd8e5d712de60db62e7759b1752ff3f06a5e..f8a66eaef61d076727c8938287210c2cb90f529b 100644 (file)
@@ -70,7 +70,7 @@ MUTATOR_HOOKFUNCTION(spawn_near_teammate, PlayerSpawn)
                        if(it.frozen == 0)
                        if(it != self)
                        {
-                               tracebox(it.origin, PL_MIN, PL_MAX, it.origin - '0 0 100', MOVE_WORLDONLY, it);
+                               tracebox(it.origin, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), it.origin - '0 0 100', MOVE_WORLDONLY, it);
                                if(trace_fraction != 1.0)
                                if(!(trace_dphitq3surfaceflags & Q3SURFACEFLAG_SKY))
                                {
@@ -87,19 +87,19 @@ MUTATOR_HOOKFUNCTION(spawn_near_teammate, PlayerSpawn)
                                                        switch(pc)
                                                        {
                                                                case 0:
-                                                                       tracebox(it.origin , PL_MIN, PL_MAX, it.origin + v_right * 128, MOVE_NORMAL, it);
+                                                                       tracebox(it.origin , STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), it.origin + v_right * 128, MOVE_NORMAL, it);
                                                                        break;
                                                                case 1:
-                                                                       tracebox(it.origin , PL_MIN, PL_MAX, it.origin - v_right * 128 , MOVE_NORMAL, it);
+                                                                       tracebox(it.origin , STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), it.origin - v_right * 128 , MOVE_NORMAL, it);
                                                                        break;
                                                                case 2:
-                                                                       tracebox(it.origin , PL_MIN, PL_MAX, it.origin + v_right * 64 - v_forward * 64, MOVE_NORMAL, it);
+                                                                       tracebox(it.origin , STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), it.origin + v_right * 64 - v_forward * 64, MOVE_NORMAL, it);
                                                                        break;
                                                                case 3:
-                                                                       tracebox(it.origin , PL_MIN, PL_MAX, it.origin - v_right * 64 - v_forward * 64, MOVE_NORMAL, it);
+                                                                       tracebox(it.origin , STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), it.origin - v_right * 64 - v_forward * 64, MOVE_NORMAL, it);
                                                                        break;
                                                                case 4:
-                                                                       tracebox(it.origin , PL_MIN, PL_MAX, it.origin - v_forward * 128, MOVE_NORMAL, it);
+                                                                       tracebox(it.origin , STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), it.origin - v_forward * 128, MOVE_NORMAL, it);
                                                                        break;
                                                        }
 
index 1fc9ccdf3cdbbc16cc0b92f074de9ead94600bc5..44614c1bd3f0e2d2ee3bb7272cdcf670277204fb 100644 (file)
@@ -107,7 +107,7 @@ void PM_ClientMovement_Unstick(entity this)
        #define X(unstick_offset) \
        { \
                vector neworigin = unstick_offset + this.origin; \
-               tracebox(neworigin, PL_CROUCH_MIN, PL_CROUCH_MAX, neworigin, MOVE_NORMAL, this); \
+               tracebox(neworigin, STAT(PL_CROUCH_MIN, NULL), STAT(PL_CROUCH_MAX, NULL), neworigin, MOVE_NORMAL, this); \
                if (!trace_startsolid) \
                { \
                        setorigin(this, neworigin); \
@@ -138,7 +138,7 @@ void PM_ClientMovement_UpdateStatus(entity this, bool ground)
                // wants to stand, if currently crouching we need to check for a low ceiling first
                if (IS_DUCKED(this))
                {
-                       tracebox(this.origin, PL_MIN, PL_MAX, this.origin, MOVE_NORMAL, this);
+                       tracebox(this.origin, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), this.origin, MOVE_NORMAL, this);
                        if (!trace_startsolid) UNSET_DUCKED(this);
                }
        }
index d0b8f9459766d583f11b3bb32a848e02e943537e..23bfcb2451ebd4086a0739e19e973c7aa97a3ee1 100644 (file)
@@ -283,7 +283,7 @@ void trigger_push_findtarget()
 
        // first calculate a typical start point for the jump
        org = (self.absmin + self.absmax) * 0.5;
-       org_z = self.absmax.z - PL_MIN.z;
+       org_z = self.absmax.z - STAT(PL_MIN, NULL).z;
 
        if (self.target)
        {
@@ -294,7 +294,7 @@ void trigger_push_findtarget()
 #ifdef SVQC
                        entity e = spawn();
                        setorigin(e, org);
-                       setsize(e, PL_MIN, PL_MAX);
+                       setsize(e, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL));
                        e.velocity = trigger_push_calculatevelocity(org, t, self.height);
                        tracetoss(e, e);
                        if(e.movetype == MOVETYPE_NONE)
@@ -327,7 +327,7 @@ void trigger_push_findtarget()
        {
                entity e = spawn();
                setorigin(e, org);
-               setsize(e, PL_MIN, PL_MAX);
+               setsize(e, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL));
                e.velocity = self.movedir;
                tracetoss(e, e);
                waypoint_spawnforteleporter(self, trace_endpos, vlen(trace_endpos - org) / vlen(e.velocity));
index 819473fe13456826ae355dea5c02a2af17e51547..cd9efff072f078108f12c356e550f6559fb169d2 100644 (file)
@@ -777,7 +777,7 @@ vector vehicles_findgoodexit(vector prefer_spot)
        //vector exitspot;
        float mysize;
 
-       tracebox(self.origin + '0 0 32', PL_MIN, PL_MAX, prefer_spot, MOVE_NORMAL, self.owner);
+       tracebox(self.origin + '0 0 32', STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), prefer_spot, MOVE_NORMAL, self.owner);
        if(trace_fraction == 1.0 && !trace_startsolid && !trace_allsolid)
                return prefer_spot;
 
@@ -790,7 +790,7 @@ vector vehicles_findgoodexit(vector prefer_spot)
                v = randomvec();
                v_z = 0;
                v = v2 + normalize(v) * mysize;
-               tracebox(v2, PL_MIN, PL_MAX, v, MOVE_NORMAL, self.owner);
+               tracebox(v2, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), v, MOVE_NORMAL, self.owner);
                if(trace_fraction == 1.0 && !trace_startsolid && !trace_allsolid)
                        return v;
        }
@@ -865,7 +865,7 @@ void vehicles_exit(bool eject)
                        WriteAngle(MSG_ONE, 0);
                }
 
-               setsize(_player, PL_MIN,PL_MAX);
+               setsize(_player, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL));
 
                _player.takedamage              = DAMAGE_AIM;
                _player.solid                   = SOLID_SLIDEBOX;
@@ -875,7 +875,7 @@ void vehicles_exit(bool eject)
                _player.alpha                   = 1;
                _player.PlayerPhysplug  = func_null;
                _player.vehicle                 = world;
-               _player.view_ofs                = PL_VIEW_OFS;
+               _player.view_ofs                = STAT(PL_VIEW_OFS, NULL);
                _player.event_damage    = PlayerDamage;
                _player.hud                             = HUD_NORMAL;
                PS(_player).m_switchweapon = _vehicle.m_switchweapon;
@@ -1044,10 +1044,10 @@ void vehicles_enter(entity pl, entity veh)
 
        veh.vehicle_hudmodel.viewmodelforclient = pl;
 
-       tracebox(pl.origin, PL_MIN, PL_MAX, pl.origin, false, pl);
+       tracebox(pl.origin, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), pl.origin, false, pl);
        pl.crouch = false;
-       pl.view_ofs = PL_VIEW_OFS;
-       setsize (pl, PL_MIN, PL_MAX);
+       pl.view_ofs = STAT(PL_VIEW_OFS, NULL);
+       setsize (pl, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL));
 
        veh.event_damage        = vehicles_damage;
        veh.nextthink           = 0;
index f279e9e2a27f90e701a5fcf97ac13731f53c6e6e..26e64d0d2691578a777b6790214c69445eb75d66 100644 (file)
@@ -209,11 +209,11 @@ vector bumblebee_gunner_findgoodexit(vector prefer_spot, entity gunner, entity p
        //vector exitspot;
        float mysize;
 
-       tracebox(gunner.origin + '0 0 32', PL_MIN, PL_MAX, prefer_spot, MOVE_NORMAL, player);
+       tracebox(gunner.origin + '0 0 32', STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), prefer_spot, MOVE_NORMAL, player);
        if(trace_fraction == 1.0 && !trace_startsolid && !trace_allsolid)
                return prefer_spot;
 
-       mysize = 1.5 * vlen(PL_MAX - PL_MIN); // can't use gunner's size, as they don't have a size
+       mysize = 1.5 * vlen(STAT(PL_MAX, NULL) - STAT(PL_MIN, NULL)); // can't use gunner's size, as they don't have a size
        float i;
        vector v, v2;
        v2 = 0.5 * (gunner.absmin + gunner.absmax);
@@ -222,7 +222,7 @@ vector bumblebee_gunner_findgoodexit(vector prefer_spot, entity gunner, entity p
                v = randomvec();
                v_z = 0;
                v = v2 + normalize(v) * mysize;
-               tracebox(v2, PL_MIN, PL_MAX, v, MOVE_NORMAL, player);
+               tracebox(v2, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), v, MOVE_NORMAL, player);
                if(trace_fraction == 1.0 && !trace_startsolid && !trace_allsolid)
                        return v;
        }
@@ -249,7 +249,7 @@ void bumblebee_gunner_exit(int _exitflag)
        }
 
        CSQCVehicleSetup(player, HUD_NORMAL);
-       setsize(player, PL_MIN, PL_MAX);
+       setsize(player, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL));
 
        player.takedamage     = DAMAGE_AIM;
        player.solid          = SOLID_SLIDEBOX;
@@ -257,7 +257,7 @@ void bumblebee_gunner_exit(int _exitflag)
        player.effects       &= ~EF_NODRAW;
        player.alpha          = 1;
        player.PlayerPhysplug = func_null;
-       player.view_ofs       = PL_VIEW_OFS;
+       player.view_ofs       = STAT(PL_VIEW_OFS, NULL);
        player.event_damage   = PlayerDamage;
        player.hud            = HUD_NORMAL;
        player.teleportable       = TELEPORT_NORMAL;
index 742607177dbb2c8c104a3727bf28d0cca6a50e93..7a829d5d1bd5eeef0a2a69e7457f2ec7a03ff358 100644 (file)
@@ -119,7 +119,8 @@ STATIC_INIT_LATE(W_PROP_reloader)
 }
 #endif
 
-#define REGISTER_WEAPON(...) EVAL(OVERLOAD(REGISTER_WEAPON, __VA_ARGS__))
+#define REGISTER_WEAPON(...) EVAL_REGISTER_WEAPON(OVERLOAD(REGISTER_WEAPON, __VA_ARGS__))
+#define EVAL_REGISTER_WEAPON(...) __VA_ARGS__
 #define REGISTER_WEAPON_2(id, inst) REGISTER(Weapons, WEP, id, m_id, inst)
 /** TODO: deprecated - remove */
 #define REGISTER_WEAPON_3(id, sname, inst) \
index 1782b349135f0392211df51a17d5dc568a99ef06..c586e907fa948de4d400f9a34ad965299b09f616 100644 (file)
@@ -131,7 +131,7 @@ void W_Porto_Touch()
        norm = trace_plane_normal;
        if(trace_ent.iscreature)
        {
-               traceline(trace_ent.origin, trace_ent.origin + '0 0 2' * PL_MIN.z, MOVE_WORLDONLY, self);
+               traceline(trace_ent.origin, trace_ent.origin + '0 0 2' * STAT(PL_MIN, NULL).z, MOVE_WORLDONLY, self);
                if(trace_fraction >= 1)
                        return;
                if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_SLICK || trace_dphitcontents & DPCONTENTS_PLAYERCLIP)
index d51119775c188be5551688c4c3838c36ed208514..869dcd7706a5e27ccf92327cf39e40bec0361989 100644 (file)
@@ -107,15 +107,15 @@ void CSQCPlayer_SetMinsMaxs(entity this)
 {
        if ((this.flags & FL_DUCKED) || !this.isplayermodel)
        {
-               this.mins = PL_CROUCH_MIN;
-               this.maxs = PL_CROUCH_MAX;
-               this.view_ofs = PL_CROUCH_VIEW_OFS;
+               this.mins = STAT(PL_CROUCH_MIN, NULL);
+               this.maxs = STAT(PL_CROUCH_MAX, NULL);
+               this.view_ofs = STAT(PL_CROUCH_VIEW_OFS, NULL);
        }
        else
        {
-               this.mins = PL_MIN;
-               this.maxs = PL_MAX;
-               this.view_ofs = PL_VIEW_OFS;
+               this.mins = STAT(PL_MIN, NULL);
+               this.maxs = STAT(PL_MAX, NULL);
+               this.view_ofs = STAT(PL_VIEW_OFS, NULL);
        }
 }
 
@@ -246,8 +246,8 @@ void CSQCPlayer_SetCamera()
 {
        const vector v0 = pmove_vel; // TRICK: pmove_vel is set by the engine when we get here. No need to network velocity
        const float vh = STAT(VIEWHEIGHT);
-       const vector pl_viewofs = PL_VIEW_OFS;
-       const vector pl_viewofs_crouch = PL_CROUCH_VIEW_OFS;
+       const vector pl_viewofs = STAT(PL_VIEW_OFS, NULL);
+       const vector pl_viewofs_crouch = STAT(PL_CROUCH_VIEW_OFS, NULL);
        const entity e = csqcplayer;
        if (e)
        {
index 128da850fe07aed9f8b9c4682ce57dbe7934d6be..b365d2626e2d39a633eb66e68fc640048d1cd160 100644 (file)
@@ -17,8 +17,8 @@
 #define CSQCMODEL_HOOK_PREDRAW
 #define CSQCPLAYER_HOOK_POSTCAMERASETUP
 
-// force updates of player entities that often even if unchanged
-#define CSQCPLAYER_FORCE_UPDATES 0.25
+// force updates of player entities this frequently (per second) even if unchanged
+#define CSQCPLAYER_FORCE_UPDATES 4
 
 // mod must define:
 //vector PL_MIN  = ...;
index cadb77467cd97605131d50edd425d8b03508dd9d..207647e0d171af30736e100c76e13d434cb88dab 100644 (file)
@@ -79,7 +79,7 @@ void CSQCModel_CheckUpdate(entity e)
        if(isplayer && time > e.csqcmodel_nextforcedupdate)
        {
                e.SendFlags |= CSQCMODEL_PROPERTY_ORIGIN;
-               e.csqcmodel_nextforcedupdate = time + CSQCPLAYER_FORCE_UPDATES * (0.5 + random()); // ensure about 4 origin sends per sec
+               e.csqcmodel_nextforcedupdate = time + (1 / (CSQCPLAYER_FORCE_UPDATES)) * (0.5 + random()); // ensure about 4 origin sends per sec
        }
 #endif
 
index d79ae11544d5467ccbc93e9d7e3bdbb954cd0b19..3a98c96061b587a78df703b407cc79d57652edfd 100644 (file)
@@ -84,7 +84,8 @@ const noref vector default_vector = '0 0 0';
        __AUTOCVAR(file, archive, var, type, desc, default_##type)
 #define AUTOCVAR_6(file, archive, var, type, default, desc) \
        __AUTOCVAR(file, archive, var, type, desc, default)
-#define _AUTOCVAR(...) EVAL(OVERLOAD(AUTOCVAR, __FILE__, __VA_ARGS__))
+#define _AUTOCVAR(...) EVAL__AUTOCVAR(OVERLOAD(AUTOCVAR, __FILE__, __VA_ARGS__))
+#define EVAL__AUTOCVAR(...) __VA_ARGS__
 #define AUTOCVAR_SAVE(...) _AUTOCVAR(true, __VA_ARGS__)
 #define AUTOCVAR(...) _AUTOCVAR(false, __VA_ARGS__)
 
index 192ffd79a7dc1c672c87b3d3208033bdb31b15b7..b56493748a3b527ba0689e45cf898d27c367b430 100644 (file)
@@ -45,7 +45,8 @@ entity LL_POP(LinkedList this)
        return e;
 }
 
-#define LL_CLEAR(...) EVAL(OVERLOAD(LL_CLEAR, __VA_ARGS__))
+#define LL_CLEAR(...) EVAL_LL_CLEAR(OVERLOAD(LL_CLEAR, __VA_ARGS__))
+#define EVAL_LL_CLEAR(...) __VA_ARGS__
 #define LL_CLEAR_1(this) LL_CLEAR_2(this, LAMBDA())
 #define LL_CLEAR_2(this, dtor) \
        MACRO_BEGIN \
@@ -61,7 +62,8 @@ entity LL_POP(LinkedList this)
                } \
        } MACRO_END
 
-#define LL_DELETE(...) EVAL(OVERLOAD(LL_DELETE, __VA_ARGS__))
+#define LL_DELETE(...) EVAL_LL_DELETE(OVERLOAD(LL_DELETE, __VA_ARGS__))
+#define EVAL_LL_DELETE(...) __VA_ARGS__
 #define LL_DELETE_1(this) LL_DELETE_2(this, LAMBDA())
 #define LL_DELETE_2(this, dtor) \
        MACRO_BEGIN \
index a2cc17e2382101dcdb00daa7d077a6832cbe1f30..05a20dc19df061b6a5c246b3dbfd27e177f58e0d 100644 (file)
@@ -58,7 +58,8 @@ entity __spawn(string _classname, string _sourceFile, int _sourceLine, bool pure
 }
 
 
-#define entityclass(...) EVAL(OVERLOAD(entityclass, __VA_ARGS__))
+#define entityclass(...) EVAL_entityclass(OVERLOAD(entityclass, __VA_ARGS__))
+#define EVAL_entityclass(...) __VA_ARGS__
 #define entityclass_1(name) entityclass_2(name, Object)
 #ifndef QCC_SUPPORT_ENTITYCLASS
        #define entityclass_2(name, base) typedef entity name
index 344ee83fbe67fea5d8511e44fa68a4cebecabe88..8f0d0740e20ffe35dce32696bb4db01c60365959 100644 (file)
@@ -53,7 +53,8 @@ REGISTRY(Registries, BITS(8))
  * @param fld       The field to store the locally unique unique entity id
  * @param inst      An expression to create a new instance, invoked for every registration
  */
-#define REGISTER(...) EVAL(OVERLOAD(REGISTER, __VA_ARGS__))
+#define REGISTER(...) EVAL_REGISTER(OVERLOAD(REGISTER, __VA_ARGS__))
+#define EVAL_REGISTER(...) __VA_ARGS__
 #define REGISTER_5(registry, ns, id, fld, inst) REGISTER_4(registry, ns##_##id, fld, inst)
 #define REGISTER_4(registry, id, fld, inst) \
        entity id; \
@@ -93,7 +94,8 @@ REGISTRY(Registries, BITS(8))
 #define REGISTRY_NEXT enemy
 .entity REGISTRY_NEXT;
 
-#define REGISTRY_SORT(...) EVAL(OVERLOAD(REGISTRY_SORT, __VA_ARGS__))
+#define REGISTRY_SORT(...) EVAL_REGISTRY_SORT(OVERLOAD(REGISTRY_SORT, __VA_ARGS__))
+#define EVAL_REGISTRY_SORT(...) __VA_ARGS__
 #define REGISTRY_SORT_1(id) REGISTRY_SORT_2(id, 0)
 #define REGISTRY_SORT_2(id, skip) \
        void _REGISTRY_SWAP_##id(int i, int j, entity pass) \
@@ -163,7 +165,8 @@ void Registry_send(string id, string hash);
        } \
        void Registry_send_all() { Registry_send(#id, REGISTRY_HASH(id)); } \
 
-#define REGISTER_REGISTRY(...) EVAL(OVERLOAD(REGISTER_REGISTRY, __VA_ARGS__))
+#define REGISTER_REGISTRY(...) EVAL_REGISTER_REGISTRY(OVERLOAD(REGISTER_REGISTRY, __VA_ARGS__))
+#define EVAL_REGISTER_REGISTRY(...) __VA_ARGS__
 #define REGISTER_REGISTRY_1(id) REGISTER_REGISTRY_2(id, #id)
 #define REGISTER_REGISTRY_2(id, str) \
        ACCUMULATE_FUNCTION(__static_init, Register##id) \
index b74a881f35b8761f667165c6649b992bd07ed834..a7b854cd17d446d8263199629358aa19c1b8baa1 100644 (file)
@@ -2,7 +2,8 @@
 #define REPLICATE_H
 #ifndef MENUQC
 
-       #define REPLICATE(...) EVAL(OVERLOAD(REPLICATE, __VA_ARGS__))
+       #define REPLICATE(...) EVAL_REPLICATE(OVERLOAD(REPLICATE, __VA_ARGS__))
+       #define EVAL_REPLICATE(...) __VA_ARGS__
 
        [[accumulate]] void ReplicateVars(entity this, string thisname, int i) {}
 
index ef0d68f008d2cdc66b0ab2a1c815df416521f996..ce3c512c1d4cbed378fd2e9397a2356836e7ac7a 100644 (file)
@@ -84,12 +84,13 @@ noref bool require_spawnfunc_prefix;
 
        #define FIELDS_COMMON(fld) \
                FIELD_SCALAR(fld, classname) \
+               FIELD_SCALAR(fld, sourceLocFile) \
+               FIELD_SCALAR(fld, sourceLocLine) \
                FIELD_SCALAR(fld, spawnfunc_checked) \
+               FIELD_VEC(fld, origin) \
                /**/
 
        #define FIELDS_UNION(fld) \
-               FIELD_SCALAR(fld, sourceLocFile) \
-               FIELD_SCALAR(fld, sourceLocLine) \
                FIELD_SCALAR(fld, Version) \
                FIELD_SCALAR(fld, ammo_cells) \
                FIELD_SCALAR(fld, ammo_nails) \
@@ -189,10 +190,10 @@ noref bool require_spawnfunc_prefix;
                FIELD_VEC(fld, maxs) \
                FIELD_VEC(fld, mins) \
                FIELD_VEC(fld, modelscale_vec) \
-               FIELD_VEC(fld, origin) \
                FIELD_VEC(fld, velocity) \
                /**/
 
-       #define spawnfunc(...) EVAL(OVERLOAD(spawnfunc, __VA_ARGS__))
+       #define spawnfunc(...) EVAL_spawnfunc(OVERLOAD(spawnfunc, __VA_ARGS__))
+       #define EVAL_spawnfunc(...) __VA_ARGS__
 
 #endif
index 7e0dec5b2a3685e4c35f4f4c87b01e6264c35e9c..3f258df52d69e7b2288722d7161e78c9254ba679 100644 (file)
@@ -9,11 +9,13 @@
 .int m_id;
 typedef vector vectori;
 
-#define REGISTER_STAT(...) EVAL(OVERLOAD(REGISTER_STAT, __VA_ARGS__))
+#define REGISTER_STAT(...) EVAL_REGISTER_STAT(OVERLOAD(REGISTER_STAT, __VA_ARGS__))
+#define EVAL_REGISTER_STAT(...) __VA_ARGS__
 #if defined(CSQC)
        /** Get all stats and store them as globals, access with `STAT(ID)` */
        void stats_get() {}
-       #define STAT(...) EVAL(OVERLOAD(STAT, __VA_ARGS__))
+       #define STAT(...) EVAL_STAT(OVERLOAD(STAT, __VA_ARGS__))
+       #define EVAL_STAT(...) __VA_ARGS__
     #define STAT_1(id) STAT_2(id, NULL)
        #define STAT_2(id, cl) (0, _STAT(id))
 
@@ -40,11 +42,11 @@ typedef vector vectori;
                        if (it != CAT(_STAT(id), _prev)) \
                                CAT(_STAT(id), _prev) = _STAT(id) = it; \
                }
-       #define REGISTER_STAT_3(x, T, expr) REGISTER_STAT(x, T)
+       #define REGISTER_STAT_3(x, T, expr) REGISTER_STAT_2(x, T)
 #elif defined(SVQC)
        /** Add all registered stats, access with `STAT(ID, player)` or `.type stat = _STAT(ID); player.stat` */
        void stats_add() {}
-       #define STAT(id, cl) (cl._STAT(id))
+       #define STAT(id, cl) (cl)._STAT(id)
 
        #define addstat_int(id, fld) addstat(id, AS_INT, fld)
        #define addstat_bool(id, fld) addstat(id, AS_INT, fld)
@@ -85,16 +87,17 @@ typedef vector vectori;
                } \
                [[accumulate]] void stats_add() \
                { \
-                       addstat_##T(STAT_##id.m_id, _STAT(id)); \
+                       .T fld = _STAT(id); \
+                       addstat_##T(STAT_##id.m_id, fld); \
                }
        void GlobalStats_update(entity this) {}
-    #define REGISTER_STAT_3(x, T, expr) \
-       REGISTER_STAT(x, T); \
-       [[accumulate]] void GlobalStats_update(entity this) { STAT(x, this) = (expr); } \
-       STATIC_INIT(worldstat_##x) { entity this = world; STAT(x, this) = (expr); }
+    #define REGISTER_STAT_3(id, T, expr) \
+       REGISTER_STAT_2(id, T); \
+       [[accumulate]] void GlobalStats_update(entity this) { STAT(id, this) = (expr); } \
+       STATIC_INIT(worldstat_##id) { entity this = world; STAT(id, this) = (expr); }
 #else
        #define REGISTER_STAT_2(id, type)
-    #define REGISTER_STAT_3(x, T, expr)
+    #define REGISTER_STAT_3(id, T, expr)
 #endif
 
 const int STATS_ENGINE_RESERVE = 32;
index 12efd589676bc7ca1ae5b565705807ce2e5b9fe9..6371b6916f06953245bd20080912a33f01a50427 100644 (file)
@@ -478,7 +478,7 @@ void havocbot_movetogoal()
 
                // Flying
                self.BUTTON_HOOK = true;
-               if(self.navigation_jetpack_point.z - PL_MAX.z + PL_MIN.z < self.origin.z)
+               if(self.navigation_jetpack_point.z - STAT(PL_MAX, NULL).z + STAT(PL_MIN, NULL).z < self.origin.z)
                {
                        self.movement_x = dir * v_forward * maxspeed;
                        self.movement_y = dir * v_right * maxspeed;
index 43755799871e3ac5313fa3848160968252355bc0..7e8b8b5305b8799c2159e46e4e2b9874aaaf9ea0 100644 (file)
@@ -366,12 +366,12 @@ float navigation_waypoint_will_link(vector v, vector org, entity ent, float walk
                {
                        if (walkfromwp)
                        {
-                               if (tracewalk(ent, v, PL_MIN, PL_MAX, org, bot_navigation_movemode))
+                               if (tracewalk(ent, v, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), org, bot_navigation_movemode))
                                        return true;
                        }
                        else
                        {
-                               if (tracewalk(ent, org, PL_MIN, PL_MAX, v, bot_navigation_movemode))
+                               if (tracewalk(ent, org, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), v, bot_navigation_movemode))
                                        return true;
                        }
                }
@@ -401,7 +401,7 @@ entity navigation_findnearestwaypoint_withdist_except(entity ent, float walkfrom
        }
 
        org = ent.origin + 0.5 * (ent.mins + ent.maxs);
-       org.z = ent.origin.z + ent.mins.z - PL_MIN.z; // player height
+       org.z = ent.origin.z + ent.mins.z - STAT(PL_MIN, NULL).z; // player height
        // TODO possibly make other code have the same support for bboxes
        if(ent.tag_entity)
                org = org + ent.tag_entity.origin;
@@ -724,7 +724,7 @@ void navigation_routerating(entity e, float f, float rangebias)
                        float zdistance, xydistance, cost, t, fuel;
                        vector down, npa, npb;
 
-                       down = '0 0 -1' * (PL_MAX.z - PL_MIN.z) * 10;
+                       down = '0 0 -1' * (STAT(PL_MAX, NULL).z - STAT(PL_MIN, NULL).z) * 10;
 
                        do{
                                npa = pointa + down;
@@ -882,7 +882,7 @@ float navigation_routetogoal(entity e, vector startposition)
                return true;
 
        // if it can reach the goal there is nothing more to do
-       if (tracewalk(self, startposition, PL_MIN, PL_MAX, (e.absmin + e.absmax) * 0.5, bot_navigation_movemode))
+       if (tracewalk(self, startposition, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), (e.absmin + e.absmax) * 0.5, bot_navigation_movemode))
                return true;
 
        // see if there are waypoints describing a path to the item
@@ -1092,7 +1092,7 @@ void navigation_unstuck()
                // evaluate the next goal on the queue
                float d = vlen(self.origin - bot_waypoint_queue_goal.origin);
                bot_debug(strcat(self.netname, " evaluating ", bot_waypoint_queue_goal.classname, " with distance ", ftos(d), "\n"));
-               if(tracewalk(bot_waypoint_queue_goal, self.origin, PL_MIN, PL_MAX, bot_waypoint_queue_goal.origin, bot_navigation_movemode))
+               if(tracewalk(bot_waypoint_queue_goal, self.origin, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), bot_waypoint_queue_goal.origin, bot_navigation_movemode))
                {
                        if( d > bot_waypoint_queue_bestgoalrating)
                        {
index d159cba5839c73b5fbdee6888a01a40114d91a87..b4b614967b5a52e47e52a4e5ae8269c6afa99b3f 100644 (file)
@@ -38,7 +38,7 @@ entity waypoint_spawn(vector m1, vector m2, float f)
 
        if(!w.wpisbox)
        {
-               setsize(w, PL_MIN - '1 1 0', PL_MAX + '1 1 0');
+               setsize(w, STAT(PL_MIN, NULL) - '1 1 0', STAT(PL_MAX, NULL) + '1 1 0');
                if(!move_out_of_solid(w))
                {
                        if(!(f & WAYPOINTFLAG_GENERATED))
@@ -208,7 +208,7 @@ void waypoint_think()
                        navigation_testtracewalk = 0;
                        if (!self.wpisbox)
                        {
-                               tracebox(sv - PL_MIN.z * '0 0 1', PL_MIN, PL_MAX, sv, false, self);
+                               tracebox(sv - STAT(PL_MIN, NULL).z * '0 0 1', STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), sv, false, self);
                                if (!trace_startsolid)
                                {
                                        //dprint("sv deviation", vtos(trace_endpos - sv), "\n");
@@ -217,7 +217,7 @@ void waypoint_think()
                        }
                        if (!e.wpisbox)
                        {
-                               tracebox(ev - PL_MIN.z * '0 0 1', PL_MIN, PL_MAX, ev, false, e);
+                               tracebox(ev - STAT(PL_MIN, NULL).z * '0 0 1', STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), ev, false, e);
                                if (!trace_startsolid)
                                {
                                        //dprint("ev deviation", vtos(trace_endpos - ev), "\n");
@@ -226,11 +226,11 @@ void waypoint_think()
                        }
                        //traceline(self.origin, e.origin, false, world);
                        //if (trace_fraction == 1)
-                       if (!self.wpisbox && tracewalk(self, sv, PL_MIN, PL_MAX, ev, MOVE_NOMONSTERS))
+                       if (!self.wpisbox && tracewalk(self, sv, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), ev, MOVE_NOMONSTERS))
                                waypoint_addlink(self, e);
                        else
                                relink_walkculled += 0.5;
-                       if (!e.wpisbox && tracewalk(e, ev, PL_MIN, PL_MAX, sv, MOVE_NOMONSTERS))
+                       if (!e.wpisbox && tracewalk(e, ev, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), sv, MOVE_NOMONSTERS))
                                waypoint_addlink(e, self);
                        else
                                relink_walkculled += 0.5;
@@ -713,7 +713,7 @@ float waypoint_loadall()
 
 vector waypoint_fixorigin(vector position)
 {
-       tracebox(position + '0 0 1' * (1 - PL_MIN.z), PL_MIN, PL_MAX, position + '0 0 -512', MOVE_NOMONSTERS, world);
+       tracebox(position + '0 0 1' * (1 - STAT(PL_MIN, NULL).z), STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), position + '0 0 -512', MOVE_NOMONSTERS, world);
        if(trace_fraction < 1)
                position = trace_endpos;
        //traceline(position, position + '0 0 -512', MOVE_NOMONSTERS, world);
@@ -867,7 +867,7 @@ void botframe_showwaypointlinks()
 
 float botframe_autowaypoints_fixdown(vector v)
 {
-       tracebox(v, PL_MIN, PL_MAX, v + '0 0 -64', MOVE_NOMONSTERS, world);
+       tracebox(v, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), v + '0 0 -64', MOVE_NOMONSTERS, world);
        if(trace_fraction >= 1)
                return 0;
        return 1;
index cb1387a9c2ef5e15917f6703bfe96989eeeda497..453b2ca2b5a0d5990ecc3de7e7ee83401af944f1 100644 (file)
@@ -448,7 +448,7 @@ float CheatCommand(float argc)
                        e.nextthink = time;
                        e.solid = 0; // nothing special
                        setmodel(e, MDL_MARKER);
-                       setsize(e, PL_MIN, PL_MAX);
+                       setsize(e, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL));
                        e.skin = 2;
                        if(argc == 3)
                                e.cnt = stof(argv(1));
index bb4fc2335877f3834e38ca1b865dbafda00f7df1..ffbfe02ff946bfc4daccc38a2795359ebe13ef7e 100644 (file)
@@ -273,7 +273,7 @@ void PutObserverInServer()
        self.crouch = false;
        self.revival_time = 0;
 
-       setorigin (self, (spot.origin + PL_VIEW_OFS)); // offset it so that the spectator spawns higher off the ground, looks better this way
+       setorigin (self, (spot.origin + STAT(PL_VIEW_OFS, NULL))); // offset it so that the spectator spawns higher off the ground, looks better this way
        self.prevorigin = self.origin;
        self.items = 0;
        self.weapons = '0 0 0';
@@ -282,7 +282,7 @@ void PutObserverInServer()
        setmodel(self, MDL_Null);
        self.drawonlytoclient = self;
 
-       setsize (self, PL_CROUCH_MIN, PL_CROUCH_MAX); // give the spectator some space between walls for MOVETYPE_FLY_WORLDONLY
+       setsize (self, STAT(PL_CROUCH_MIN, NULL), STAT(PL_CROUCH_MAX, NULL)); // give the spectator some space between walls for MOVETYPE_FLY_WORLDONLY
        self.view_ofs = '0 0 0'; // so that your view doesn't go into the ceiling with MOVETYPE_FLY_WORLDONLY, previously "PL_VIEW_OFS"
 
        PS(self).m_weapon = WEP_Null;
@@ -542,8 +542,8 @@ void PutClientInServer()
                this.drawonlytoclient = NULL;
 
                this.crouch = false;
-               this.view_ofs = PL_VIEW_OFS;
-               setsize(this, PL_MIN, PL_MAX);
+               this.view_ofs = STAT(PL_VIEW_OFS, NULL);
+               setsize(this, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL));
                this.spawnorigin = spot.origin;
                setorigin(this, spot.origin + '0 0 1' * (1 - this.mins.z - 24));
                // don't reset back to last position, even if new position is stuck in solid
index 96e48cb64693458ad45e9719fc554da4747efa12..c29c10f26bf5ac8f5f8390352011c6125cc472e2 100644 (file)
@@ -515,7 +515,7 @@ IMPULSE(navwaypoint_unreachable)
        for (entity e = findchain(classname, "info_player_deathmatch"); e; e = e.chain)
        {
                vector org = e.origin;
-               tracebox(e.origin, PL_MIN, PL_MAX, e.origin - '0 0 512', MOVE_NOMONSTERS, world);
+               tracebox(e.origin, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), e.origin - '0 0 512', MOVE_NOMONSTERS, world);
                setorigin(e, trace_endpos);
                if (navigation_findnearestwaypoint(e, false))
                {
index 521dad5b59bb3bf3797e4c7dbeaa9dddc28355b1..b75eb5514e8031b005417ff5663e190ad93f3379 100644 (file)
@@ -1536,15 +1536,15 @@ void GameCommand_trace(float request, float argc)
                                                start = stov(vtos(start));
                                                end = stov(vtos(end));
 
-                                               tracebox(start, PL_MIN, PL_MAX, end, MOVE_NOMONSTERS, world);
+                                               tracebox(start, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), end, MOVE_NOMONSTERS, world);
                                                if (!trace_startsolid && trace_fraction < 1)
                                                {
                                                        p = trace_endpos;
-                                                       tracebox(p, PL_MIN, PL_MAX, p, MOVE_NOMONSTERS, world);
+                                                       tracebox(p, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), p, MOVE_NOMONSTERS, world);
                                                        if (trace_startsolid)
                                                        {
                                                                rint(42);  // do an engine breakpoint on VM_rint so you can get the trace that errnoeously returns startsolid
-                                                               tracebox(start, PL_MIN, PL_MAX, end, MOVE_NOMONSTERS, world);
+                                                               tracebox(start, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), end, MOVE_NOMONSTERS, world);
 
                                                                // how much do we need to back off?
                                                                safe = 1;
@@ -1552,7 +1552,7 @@ void GameCommand_trace(float request, float argc)
                                                                for ( ; ; )
                                                                {
                                                                        pos = p * (1 - (safe + unsafe) * 0.5) + start * ((safe + unsafe) * 0.5);
-                                                                       tracebox(pos, PL_MIN, PL_MAX, pos, MOVE_NOMONSTERS, world);
+                                                                       tracebox(pos, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), pos, MOVE_NOMONSTERS, world);
                                                                        if (trace_startsolid)
                                                                        {
                                                                                if ((safe + unsafe) * 0.5 == unsafe) break;
@@ -1568,7 +1568,7 @@ void GameCommand_trace(float request, float argc)
                                                                LOG_INFO("safe distance to back off: ", ftos(safe * vlen(p - start)), "qu\n");
                                                                LOG_INFO("unsafe distance to back off: ", ftos(unsafe * vlen(p - start)), "qu\n");
 
-                                                               tracebox(p, PL_MIN + '0.1 0.1 0.1', PL_MAX - '0.1 0.1 0.1', p, MOVE_NOMONSTERS, world);
+                                                               tracebox(p, STAT(PL_MIN, NULL) + '0.1 0.1 0.1', STAT(PL_MAX, NULL) - '0.1 0.1 0.1', p, MOVE_NOMONSTERS, world);
                                                                if (trace_startsolid) LOG_INFO("trace_endpos much in solid when tracing from ", vtos(start), " to ", vtos(end), " endpos ", vtos(p), "\n");
                                                                else LOG_INFO("trace_endpos just in solid when tracing from ", vtos(start), " to ", vtos(end), " endpos ", vtos(p), "\n");
                                                                if (++hitcount >= 10) break;
@@ -1582,7 +1582,7 @@ void GameCommand_trace(float request, float argc)
                                                                {
                                                                        q = p + normalize(end - p) * (dq + dqf);
                                                                        if (q == q0) break;
-                                                                       tracebox(p, PL_MIN, PL_MAX, q, MOVE_NOMONSTERS, world);
+                                                                       tracebox(p, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), q, MOVE_NOMONSTERS, world);
                                                                        if (trace_startsolid) error("THIS ONE cannot happen");
                                                                        if (trace_fraction > 0) dq += dqf * trace_fraction;
                                                                        dqf *= 0.5;
index 95a07a5203fb76c3e0a34a69a37887bf92e6aaa6..c536ceaa2d708c1cd8a4442e7adcd97e8d5e37bc 100644 (file)
@@ -480,7 +480,7 @@ void detect_maptype()
                o.y += random() * (world.maxs.y - world.mins.y);
                o.z += random() * (world.maxs.z - world.mins.z);
 
-               tracebox(o, PL_MIN, PL_MAX, o - '0 0 32768', MOVE_WORLDONLY, world);
+               tracebox(o, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), o - '0 0 32768', MOVE_WORLDONLY, world);
                if(trace_fraction == 1)
                        continue;
 
index 04249725457fb6e3275935d7f0e62d32e311bb1e..6a4812e58717b37bbf3e9912c57de9ef2cb90e87 100644 (file)
@@ -336,7 +336,7 @@ void kh_Key_Detach(entity key) // runs every time a key is dropped or lost. Runs
        }
        // in any case:
        setattachment(key, world, "");
-       setorigin(key, key.owner.origin + '0 0 1' * (PL_MIN.z - KH_KEY_MIN_z));
+       setorigin(key, key.owner.origin + '0 0 1' * (STAT(PL_MIN, NULL).z - KH_KEY_MIN_z));
        key.angles = key.owner.angles;
 #else
        setorigin(key, key.owner.origin + key.origin.z * '0 0 1');
index 8f311f169ce32bd5842c2b0dbbcdcfc8507ed93d..1b09ac450c7eb80c59946bbe98b6561fa207d4a0 100644 (file)
@@ -208,8 +208,8 @@ float Portal_FindSafeOrigin(entity portal)
 {
        vector o;
        o = portal.origin;
-       portal.mins = PL_MIN - SAFERNUDGE;
-       portal.maxs = PL_MAX + SAFERNUDGE;
+       portal.mins = STAT(PL_MIN, NULL) - SAFERNUDGE;
+       portal.maxs = STAT(PL_MAX, NULL) + SAFERNUDGE;
        fixedmakevectors(portal.mangle);
        portal.origin += 16 * v_forward;
        if(!move_out_of_solid(portal))
index f014f1a2b61a78dab91365219468177b1337618f..ecaaad5bbb16610711d86b1f23af3e3febf2a850 100644 (file)
@@ -934,7 +934,7 @@ spawnfunc(trigger_race_checkpoint)
                self.touch = checkpoint_touch;
 
        o = (self.absmin + self.absmax) * 0.5;
-       tracebox(o, PL_MIN, PL_MAX, o - '0 0 1' * (o.z - self.absmin.z), MOVE_NORMAL, self);
+       tracebox(o, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), o - '0 0 1' * (o.z - self.absmin.z), MOVE_NORMAL, self);
        waypoint_spawnforitem_force(self, trace_endpos);
        self.nearestwaypointtimeout = time + 1000000000;
 
@@ -983,7 +983,7 @@ spawnfunc(target_checkpoint) // defrag entity
                self.touch = checkpoint_touch;
 
        o = (self.absmin + self.absmax) * 0.5;
-       tracebox(o, PL_MIN, PL_MAX, o - '0 0 1' * (o.z - self.absmin.z), MOVE_NORMAL, self);
+       tracebox(o, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), o - '0 0 1' * (o.z - self.absmin.z), MOVE_NORMAL, self);
        waypoint_spawnforitem_force(self, trace_endpos);
        self.nearestwaypointtimeout = time + 1000000000;