From c5fcf672c473edef7139d4250398184b8ae17224 Mon Sep 17 00:00:00 2001 From: Mario Date: Sun, 25 Dec 2016 07:26:14 +1000 Subject: [PATCH] Use the constants for player hitbox size when applicable (should fix observer hitbox) --- .../gamemode/onslaught/sv_onslaught.qc | 6 +++--- .../sv_spawn_near_teammate.qc | 18 +++++++++--------- qcsrc/common/physics/player.qc | 2 +- qcsrc/common/triggers/trigger/jumppads.qc | 6 +++--- qcsrc/common/vehicles/sv_vehicles.qc | 13 +++++++------ qcsrc/common/vehicles/vehicle/bumblebee.qc | 10 +++++----- qcsrc/common/weapons/weapon/porto.qc | 3 ++- qcsrc/lib/csqcmodel/cl_player.qc | 16 ++++++++-------- qcsrc/server/bot/default/havocbot/havocbot.qc | 2 +- qcsrc/server/bot/default/navigation.qc | 12 ++++++------ qcsrc/server/bot/default/waypoints.qc | 14 +++++++------- qcsrc/server/cheats.qc | 2 +- qcsrc/server/client.qc | 4 ++-- qcsrc/server/command/sv_cmd.qc | 12 ++++++------ qcsrc/server/impulse.qc | 2 +- .../mutators/mutator/gamemode_keyhunt.qc | 2 +- qcsrc/server/portals.qc | 4 ++-- qcsrc/server/race.qc | 4 ++-- 18 files changed, 67 insertions(+), 65 deletions(-) diff --git a/qcsrc/common/gamemodes/gamemode/onslaught/sv_onslaught.qc b/qcsrc/common/gamemodes/gamemode/onslaught/sv_onslaught.qc index 572611c5d..195a3bd98 100644 --- a/qcsrc/common/gamemodes/gamemode/onslaught/sv_onslaught.qc +++ b/qcsrc/common/gamemodes/gamemode/onslaught/sv_onslaught.qc @@ -1638,7 +1638,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, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), loc, MOVE_NORMAL, player); + tracebox(loc, STAT(PL_MIN, player), STAT(PL_MAX, player), 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 NULL @@ -1757,7 +1757,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, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), loc, MOVE_NORMAL, player); + tracebox(loc, STAT(PL_MIN, player), STAT(PL_MAX, player), loc, MOVE_NORMAL, player); 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 NULL @@ -1808,7 +1808,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, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), loc, MOVE_NORMAL, player); + tracebox(loc, STAT(PL_MIN, player), STAT(PL_MAX, player), loc, MOVE_NORMAL, player); 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 NULL diff --git a/qcsrc/common/mutators/mutator/spawn_near_teammate/sv_spawn_near_teammate.qc b/qcsrc/common/mutators/mutator/spawn_near_teammate/sv_spawn_near_teammate.qc index 5f11777c2..a0017f94d 100644 --- a/qcsrc/common/mutators/mutator/spawn_near_teammate/sv_spawn_near_teammate.qc +++ b/qcsrc/common/mutators/mutator/spawn_near_teammate/sv_spawn_near_teammate.qc @@ -116,22 +116,22 @@ MUTATOR_HOOKFUNCTION(spawn_near_teammate, PlayerSpawn) switch(i) { case 0: - tracebox(it.origin, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), it.origin - v_forward * 64 + v_right * 128 + v_up * 64, MOVE_NOMONSTERS, it); + tracebox(it.origin, STAT(PL_MIN, player), STAT(PL_MAX, player), it.origin - v_forward * 64 + v_right * 128 + v_up * 64, MOVE_NOMONSTERS, it); break; case 1: - tracebox(it.origin, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), it.origin - v_forward * 64 - v_right * 128 + v_up * 64, MOVE_NOMONSTERS, it); + tracebox(it.origin, STAT(PL_MIN, player), STAT(PL_MAX, player), it.origin - v_forward * 64 - v_right * 128 + v_up * 64, MOVE_NOMONSTERS, it); break; case 2: - tracebox(it.origin, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), it.origin + v_right * 192 + v_up * 64, MOVE_NOMONSTERS, it); + tracebox(it.origin, STAT(PL_MIN, player), STAT(PL_MAX, player), it.origin + v_right * 192 + v_up * 64, MOVE_NOMONSTERS, it); break; case 3: - tracebox(it.origin, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), it.origin - v_right * 192 + v_up * 64, MOVE_NOMONSTERS, it); + tracebox(it.origin, STAT(PL_MIN, player), STAT(PL_MAX, player), it.origin - v_right * 192 + v_up * 64, MOVE_NOMONSTERS, it); break; case 4: - tracebox(it.origin, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), it.origin - v_forward * 128 + v_right * 64 + v_up * 64, MOVE_NOMONSTERS, it); + tracebox(it.origin, STAT(PL_MIN, player), STAT(PL_MAX, player), it.origin - v_forward * 128 + v_right * 64 + v_up * 64, MOVE_NOMONSTERS, it); break; case 5: - tracebox(it.origin, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), it.origin - v_forward * 128 - v_right * 64 + v_up * 64, MOVE_NOMONSTERS, it); + tracebox(it.origin, STAT(PL_MIN, player), STAT(PL_MAX, player), it.origin - v_forward * 128 - v_right * 64 + v_up * 64, MOVE_NOMONSTERS, it); break; } @@ -141,17 +141,17 @@ MUTATOR_HOOKFUNCTION(spawn_near_teammate, PlayerSpawn) // 400 is about the height of a typical laser jump (in overkill) // not traceline because we need space for the whole player, not just his origin - tracebox(horizontal_trace_endpos, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), horizontal_trace_endpos - '0 0 400', MOVE_NORMAL, it); + tracebox(horizontal_trace_endpos, STAT(PL_MIN, player), STAT(PL_MAX, player), horizontal_trace_endpos - '0 0 400', MOVE_NORMAL, it); vector vectical_trace_endpos = trace_endpos; //te_lightning1(NULL, horizontal_trace_endpos, vectical_trace_endpos); if (trace_startsolid) goto skip; // inside another player if (trace_fraction == 1.0) goto skip; // above void or too high if (trace_dphitq3surfaceflags & Q3SURFACEFLAG_SKY) goto skip; if (pointcontents(vectical_trace_endpos) != CONTENT_EMPTY) goto skip; // no lava or slime (or water which i assume would be annoying anyway) - if (tracebox_hits_trigger_hurt(horizontal_trace_endpos, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), vectical_trace_endpos)) goto skip; + if (tracebox_hits_trigger_hurt(horizontal_trace_endpos, STAT(PL_MIN, player), STAT(PL_MAX, player), vectical_trace_endpos)) goto skip; // make sure the spawned player will have floor ahead (or at least a wall - he shouldn't fall as soon as he starts moving) - vector floor_test_start = vectical_trace_endpos + v_up * STAT(PL_MAX, NULL).z + v_forward * STAT(PL_MAX, NULL).x; // top front of player's bbox - highest point we know is not inside solid + vector floor_test_start = vectical_trace_endpos + v_up * STAT(PL_MAX, player).z + v_forward * STAT(PL_MAX, player).x; // top front of player's bbox - highest point we know is not inside solid traceline(floor_test_start, floor_test_start + v_forward * 100 - v_up * 128, MOVE_NOMONSTERS, it); //te_beam(NULL, floor_test_start, trace_endpos); if (trace_fraction == 1.0) goto skip; diff --git a/qcsrc/common/physics/player.qc b/qcsrc/common/physics/player.qc index 6e6dd9fb0..58828c410 100644 --- a/qcsrc/common/physics/player.qc +++ b/qcsrc/common/physics/player.qc @@ -115,7 +115,7 @@ void PM_ClientMovement_UpdateStatus(entity this) // wants to stand, if currently crouching we need to check for a low ceiling first if (IS_DUCKED(this)) { - tracebox(this.origin, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), this.origin, MOVE_NORMAL, this); + tracebox(this.origin, STAT(PL_MIN, this), STAT(PL_MAX, this), this.origin, MOVE_NORMAL, this); if (!trace_startsolid) UNSET_DUCKED(this); } } diff --git a/qcsrc/common/triggers/trigger/jumppads.qc b/qcsrc/common/triggers/trigger/jumppads.qc index edbe9c580..5a279561d 100644 --- a/qcsrc/common/triggers/trigger/jumppads.qc +++ b/qcsrc/common/triggers/trigger/jumppads.qc @@ -277,7 +277,7 @@ void trigger_push_findtarget(entity this) { // first calculate a typical start point for the jump vector org = (this.absmin + this.absmax) * 0.5; - org_z = this.absmax.z - STAT(PL_MIN, NULL).z; + org.z = this.absmax.z - PL_MIN_CONST.z; if (this.target) { @@ -288,7 +288,7 @@ void trigger_push_findtarget(entity this) #ifdef SVQC entity e = spawn(); setorigin(e, org); - setsize(e, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL)); + setsize(e, PL_MIN_CONST, PL_MAX_CONST); e.velocity = trigger_push_calculatevelocity(org, t, this.height); tracetoss(e, e); if(e.move_movetype == MOVETYPE_NONE) @@ -321,7 +321,7 @@ void trigger_push_findtarget(entity this) { entity e = spawn(); setorigin(e, org); - setsize(e, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL)); + setsize(e, PL_MIN_CONST, PL_MAX_CONST); e.velocity = this.movedir; tracetoss(e, e); waypoint_spawnforteleporter(this, trace_endpos, vlen(trace_endpos - org) / vlen(e.velocity)); diff --git a/qcsrc/common/vehicles/sv_vehicles.qc b/qcsrc/common/vehicles/sv_vehicles.qc index b165bb3e4..9c8d05ce4 100644 --- a/qcsrc/common/vehicles/sv_vehicles.qc +++ b/qcsrc/common/vehicles/sv_vehicles.qc @@ -739,7 +739,8 @@ void vehicles_impact(entity this, float _minspeed, float _speedfac, float _maxpa // vehicle enter/exit handling vector vehicles_findgoodexit(entity this, vector prefer_spot) { - tracebox(this.origin + '0 0 32', STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), prefer_spot, MOVE_NORMAL, this.owner); + // TODO: we actually want the player's size here + tracebox(this.origin + '0 0 32', PL_MIN_CONST, PL_MAX_CONST, prefer_spot, MOVE_NORMAL, this.owner); if(trace_fraction == 1.0 && !trace_startsolid && !trace_allsolid) return prefer_spot; @@ -751,7 +752,7 @@ vector vehicles_findgoodexit(entity this, vector prefer_spot) v = randomvec(); v_z = 0; v = v2 + normalize(v) * mysize; - tracebox(v2, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), v, MOVE_NORMAL, this.owner); + tracebox(v2, PL_MIN_CONST, PL_MAX_CONST, v, MOVE_NORMAL, this.owner); if(trace_fraction == 1.0 && !trace_startsolid && !trace_allsolid) return v; } @@ -793,7 +794,7 @@ void vehicles_exit(entity vehic, bool eject) WriteAngle(MSG_ONE, 0); } - setsize(player, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL)); + setsize(player, STAT(PL_MIN,player), STAT(PL_MAX, player)); player.takedamage = DAMAGE_AIM; player.solid = SOLID_SLIDEBOX; @@ -803,7 +804,7 @@ void vehicles_exit(entity vehic, bool eject) player.alpha = 1; player.PlayerPhysplug = func_null; player.vehicle = NULL; - player.view_ofs = STAT(PL_VIEW_OFS, NULL); + player.view_ofs = STAT(PL_VIEW_OFS, player); player.event_damage = PlayerDamage; player.hud = HUD_NORMAL; PS(player).m_switchweapon = vehic.m_switchweapon; @@ -959,8 +960,8 @@ void vehicles_enter(entity pl, entity veh) veh.vehicle_hudmodel.viewmodelforclient = pl; pl.crouch = false; - pl.view_ofs = STAT(PL_VIEW_OFS, NULL); - setsize (pl, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL)); + pl.view_ofs = STAT(PL_VIEW_OFS, pl); + setsize (pl, STAT(PL_MIN, pl), STAT(PL_MAX, pl)); veh.event_damage = vehicles_damage; veh.nextthink = 0; diff --git a/qcsrc/common/vehicles/vehicle/bumblebee.qc b/qcsrc/common/vehicles/vehicle/bumblebee.qc index 95cc74802..573e46aa7 100644 --- a/qcsrc/common/vehicles/vehicle/bumblebee.qc +++ b/qcsrc/common/vehicles/vehicle/bumblebee.qc @@ -184,11 +184,11 @@ vector bumblebee_gunner_findgoodexit(vector prefer_spot, entity gunner, entity p //vector exitspot; float mysize; - tracebox(gunner.origin + '0 0 32', STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), prefer_spot, MOVE_NORMAL, player); + tracebox(gunner.origin + '0 0 32', STAT(PL_MIN, player), STAT(PL_MAX, player), prefer_spot, MOVE_NORMAL, player); if(trace_fraction == 1.0 && !trace_startsolid && !trace_allsolid) return prefer_spot; - 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 + mysize = 1.5 * vlen(STAT(PL_MAX, player) - STAT(PL_MIN, player)); // 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); @@ -197,7 +197,7 @@ vector bumblebee_gunner_findgoodexit(vector prefer_spot, entity gunner, entity p v = randomvec(); v_z = 0; v = v2 + normalize(v) * mysize; - tracebox(v2, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), v, MOVE_NORMAL, player); + tracebox(v2, STAT(PL_MIN, player), STAT(PL_MAX, player), v, MOVE_NORMAL, player); if(trace_fraction == 1.0 && !trace_startsolid && !trace_allsolid) return v; } @@ -224,7 +224,7 @@ void bumblebee_gunner_exit(entity this, int _exitflag) } CSQCVehicleSetup(player, HUD_NORMAL); - setsize(player, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL)); + setsize(player, STAT(PL_MIN, player), STAT(PL_MAX, player)); player.takedamage = DAMAGE_AIM; player.solid = SOLID_SLIDEBOX; @@ -232,7 +232,7 @@ void bumblebee_gunner_exit(entity this, int _exitflag) player.effects &= ~EF_NODRAW; player.alpha = 1; player.PlayerPhysplug = func_null; - player.view_ofs = STAT(PL_VIEW_OFS, NULL); + player.view_ofs = STAT(PL_VIEW_OFS, player); player.event_damage = PlayerDamage; player.hud = HUD_NORMAL; player.teleportable = TELEPORT_NORMAL; diff --git a/qcsrc/common/weapons/weapon/porto.qc b/qcsrc/common/weapons/weapon/porto.qc index 3e4654fcb..b998bc9ee 100644 --- a/qcsrc/common/weapons/weapon/porto.qc +++ b/qcsrc/common/weapons/weapon/porto.qc @@ -133,7 +133,8 @@ void W_Porto_Touch(entity this, entity toucher) norm = trace_plane_normal; if(trace_ent.iscreature) { - traceline(trace_ent.origin, trace_ent.origin + '0 0 2' * STAT(PL_MIN, NULL).z, MOVE_WORLDONLY, this); + // TODO: why not use entity size? + traceline(trace_ent.origin, trace_ent.origin + '0 0 2' * PL_MIN_CONST.z, MOVE_WORLDONLY, this); if(trace_fraction >= 1) return; if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_SLICK || trace_dphitcontents & DPCONTENTS_PLAYERCLIP) diff --git a/qcsrc/lib/csqcmodel/cl_player.qc b/qcsrc/lib/csqcmodel/cl_player.qc index 66613b532..9e26e70fb 100644 --- a/qcsrc/lib/csqcmodel/cl_player.qc +++ b/qcsrc/lib/csqcmodel/cl_player.qc @@ -109,15 +109,15 @@ void CSQCPlayer_SetMinsMaxs(entity this) { if (IS_DUCKED(this) || !this.isplayermodel) { - this.mins = STAT(PL_CROUCH_MIN, NULL); - this.maxs = STAT(PL_CROUCH_MAX, NULL); - this.view_ofs = STAT(PL_CROUCH_VIEW_OFS, NULL); + this.mins = STAT(PL_CROUCH_MIN, this); + this.maxs = STAT(PL_CROUCH_MAX, this); + this.view_ofs = STAT(PL_CROUCH_VIEW_OFS, this); } else { - this.mins = STAT(PL_MIN, NULL); - this.maxs = STAT(PL_MAX, NULL); - this.view_ofs = STAT(PL_VIEW_OFS, NULL); + this.mins = STAT(PL_MIN, this); + this.maxs = STAT(PL_MAX, this); + this.view_ofs = STAT(PL_VIEW_OFS, this); } } @@ -226,8 +226,8 @@ void CSQCPlayer_SetCamera() { const vector v0 = ((intermission && !autocvar_cl_movement_intermissionrunning) ? '0 0 0' : 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 = STAT(PL_VIEW_OFS, NULL); - const vector pl_viewofs_crouch = STAT(PL_CROUCH_VIEW_OFS, NULL); + const vector pl_viewofs = STAT(PL_VIEW_OFS); + const vector pl_viewofs_crouch = STAT(PL_CROUCH_VIEW_OFS); const entity e = csqcplayer; if (e) { diff --git a/qcsrc/server/bot/default/havocbot/havocbot.qc b/qcsrc/server/bot/default/havocbot/havocbot.qc index b23c15bca..c26d768b0 100644 --- a/qcsrc/server/bot/default/havocbot/havocbot.qc +++ b/qcsrc/server/bot/default/havocbot/havocbot.qc @@ -480,7 +480,7 @@ void havocbot_movetogoal(entity this) // Flying PHYS_INPUT_BUTTON_HOOK(this) = true; - if(this.navigation_jetpack_point.z - STAT(PL_MAX, NULL).z + STAT(PL_MIN, NULL).z < this.origin.z) + if(this.navigation_jetpack_point.z - STAT(PL_MAX, this).z + STAT(PL_MIN, this).z < this.origin.z) { this.movement_x = dir * v_forward * maxspeed; this.movement_y = dir * v_right * maxspeed; diff --git a/qcsrc/server/bot/default/navigation.qc b/qcsrc/server/bot/default/navigation.qc index 19c0ed8e6..90bfcc4e3 100644 --- a/qcsrc/server/bot/default/navigation.qc +++ b/qcsrc/server/bot/default/navigation.qc @@ -360,12 +360,12 @@ float navigation_waypoint_will_link(vector v, vector org, entity ent, float walk { if (walkfromwp) { - if (tracewalk(ent, v, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), org, bot_navigation_movemode)) + if (tracewalk(ent, v, STAT(PL_MIN, ent), STAT(PL_MAX, ent), org, bot_navigation_movemode)) return true; } else { - if (tracewalk(ent, org, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), v, bot_navigation_movemode)) + if (tracewalk(ent, org, STAT(PL_MIN, ent), STAT(PL_MAX, ent), v, bot_navigation_movemode)) return true; } } @@ -387,7 +387,7 @@ entity navigation_findnearestwaypoint_withdist_except(entity ent, float walkfrom }); vector org = ent.origin + 0.5 * (ent.mins + ent.maxs); - org.z = ent.origin.z + ent.mins.z - STAT(PL_MIN, NULL).z; // player height + org.z = ent.origin.z + ent.mins.z - STAT(PL_MIN, ent).z; // player height // TODO possibly make other code have the same support for bboxes if(ent.tag_entity) org = org + ent.tag_entity.origin; @@ -684,7 +684,7 @@ void navigation_routerating(entity this, entity e, float f, float rangebias) float zdistance, xydistance, cost, t, fuel; vector down, npa, npb; - down = '0 0 -1' * (STAT(PL_MAX, NULL).z - STAT(PL_MIN, NULL).z) * 10; + down = '0 0 -1' * (STAT(PL_MAX, this).z - STAT(PL_MIN, this).z) * 10; do{ npa = pointa + down; @@ -842,7 +842,7 @@ bool navigation_routetogoal(entity this, entity e, vector startposition) return true; // if it can reach the goal there is nothing more to do - if (tracewalk(this, startposition, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), (e.absmin + e.absmax) * 0.5, bot_navigation_movemode)) + if (tracewalk(this, startposition, STAT(PL_MIN, this), STAT(PL_MAX, this), (e.absmin + e.absmax) * 0.5, bot_navigation_movemode)) return true; // see if there are waypoints describing a path to the item @@ -1046,7 +1046,7 @@ void navigation_unstuck(entity this) // evaluate the next goal on the queue float d = vlen2(this.origin - bot_waypoint_queue_goal.origin); LOG_DEBUG(this.netname, " evaluating ", bot_waypoint_queue_goal.classname, " with distance ", ftos(d)); - if(tracewalk(bot_waypoint_queue_goal, this.origin, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), bot_waypoint_queue_goal.origin, bot_navigation_movemode)) + if(tracewalk(bot_waypoint_queue_goal, this.origin, STAT(PL_MIN, this), STAT(PL_MAX, this), bot_waypoint_queue_goal.origin, bot_navigation_movemode)) { if( d > bot_waypoint_queue_bestgoalrating) { diff --git a/qcsrc/server/bot/default/waypoints.qc b/qcsrc/server/bot/default/waypoints.qc index 0f8999a8d..1e03bf5e1 100644 --- a/qcsrc/server/bot/default/waypoints.qc +++ b/qcsrc/server/bot/default/waypoints.qc @@ -61,7 +61,7 @@ entity waypoint_spawn(vector m1, vector m2, float f) if(!w.wpisbox) { - setsize(w, STAT(PL_MIN, NULL) - '1 1 0', STAT(PL_MAX, NULL) + '1 1 0'); + setsize(w, PL_MIN_CONST - '1 1 0', PL_MAX_CONST + '1 1 0'); if(!move_out_of_solid(w)) { if(!(f & WAYPOINTFLAG_GENERATED)) @@ -216,7 +216,7 @@ void waypoint_think(entity this) navigation_testtracewalk = 0; if (!this.wpisbox) { - tracebox(sv - STAT(PL_MIN, NULL).z * '0 0 1', STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), sv, false, this); + tracebox(sv - PL_MIN_CONST.z * '0 0 1', PL_MIN_CONST, PL_MAX_CONST, sv, false, this); if (!trace_startsolid) { //dprint("sv deviation", vtos(trace_endpos - sv), "\n"); @@ -225,7 +225,7 @@ void waypoint_think(entity this) } if (!it.wpisbox) { - tracebox(ev - STAT(PL_MIN, NULL).z * '0 0 1', STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), ev, false, it); + tracebox(ev - PL_MIN_CONST.z * '0 0 1', PL_MIN_CONST, PL_MAX_CONST, ev, false, it); if (!trace_startsolid) { //dprint("ev deviation", vtos(trace_endpos - ev), "\n"); @@ -234,11 +234,11 @@ void waypoint_think(entity this) } //traceline(this.origin, it.origin, false, NULL); //if (trace_fraction == 1) - if (!this.wpisbox && tracewalk(this, sv, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), ev, MOVE_NOMONSTERS)) + if (!this.wpisbox && tracewalk(this, sv, PL_MIN_CONST, PL_MAX_CONST, ev, MOVE_NOMONSTERS)) waypoint_addlink(this, it); else relink_walkculled += 0.5; - if (!it.wpisbox && tracewalk(it, ev, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), sv, MOVE_NOMONSTERS)) + if (!it.wpisbox && tracewalk(it, ev, PL_MIN_CONST, PL_MAX_CONST, sv, MOVE_NOMONSTERS)) waypoint_addlink(it, this); else relink_walkculled += 0.5; @@ -685,7 +685,7 @@ float waypoint_loadall() vector waypoint_fixorigin(vector position) { - 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, NULL); + tracebox(position + '0 0 1' * (1 - PL_MIN_CONST.z), PL_MIN_CONST, PL_MAX_CONST, position + '0 0 -512', MOVE_NOMONSTERS, NULL); if(trace_fraction < 1) position = trace_endpos; //traceline(position, position + '0 0 -512', MOVE_NOMONSTERS, NULL); @@ -833,7 +833,7 @@ void botframe_showwaypointlinks() float botframe_autowaypoints_fixdown(vector v) { - tracebox(v, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), v + '0 0 -64', MOVE_NOMONSTERS, NULL); + tracebox(v, PL_MIN_CONST, PL_MAX_CONST, v + '0 0 -64', MOVE_NOMONSTERS, NULL); if(trace_fraction >= 1) return 0; return 1; diff --git a/qcsrc/server/cheats.qc b/qcsrc/server/cheats.qc index cf8a4569b..3d569222c 100644 --- a/qcsrc/server/cheats.qc +++ b/qcsrc/server/cheats.qc @@ -444,7 +444,7 @@ float CheatCommand(entity this, int argc) e.nextthink = time; e.solid = 0; // nothing special setmodel(e, MDL_MARKER); - setsize(e, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL)); + setsize(e, STAT(PL_MIN, this), STAT(PL_MAX, this)); e.skin = 2; if(argc == 3) e.cnt = stof(argv(1)); diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index 9583118ce..d4a3e9feb 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -236,7 +236,7 @@ void PutObserverInServer(entity this) this.angles_z = 0; this.fixangle = true; // offset it so that the spectator spawns higher off the ground, looks better this way - setorigin(this, spot.origin + STAT(PL_VIEW_OFS, NULL)); + setorigin(this, spot.origin + STAT(PL_VIEW_OFS, this)); this.prevorigin = this.origin; if (IS_REAL_CLIENT(this)) { @@ -253,7 +253,7 @@ void PutObserverInServer(entity this) FixPlayermodel(this); } setmodel(this, MDL_Null); - setsize(this, STAT(PL_CROUCH_MIN, NULL), STAT(PL_CROUCH_MAX, NULL)); + setsize(this, STAT(PL_CROUCH_MIN, this), STAT(PL_CROUCH_MAX, this)); this.view_ofs = '0 0 0'; } diff --git a/qcsrc/server/command/sv_cmd.qc b/qcsrc/server/command/sv_cmd.qc index 76e913500..55879fd35 100644 --- a/qcsrc/server/command/sv_cmd.qc +++ b/qcsrc/server/command/sv_cmd.qc @@ -1528,15 +1528,15 @@ void GameCommand_trace(float request, float argc) start = stov(vtos(start)); end = stov(vtos(end)); - tracebox(start, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), end, MOVE_NOMONSTERS, NULL); + tracebox(start, PL_MIN_CONST, PL_MAX_CONST, end, MOVE_NOMONSTERS, NULL); if (!trace_startsolid && trace_fraction < 1) { p = trace_endpos; - tracebox(p, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), p, MOVE_NOMONSTERS, NULL); + tracebox(p, PL_MIN_CONST, PL_MAX_CONST, p, MOVE_NOMONSTERS, NULL); if (trace_startsolid) { rint(42); // do an engine breakpoint on VM_rint so you can get the trace that errnoeously returns startsolid - tracebox(start, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), end, MOVE_NOMONSTERS, NULL); + tracebox(start, PL_MIN_CONST, PL_MAX_CONST, end, MOVE_NOMONSTERS, NULL); // how much do we need to back off? safe = 1; @@ -1544,7 +1544,7 @@ void GameCommand_trace(float request, float argc) for ( ; ; ) { pos = p * (1 - (safe + unsafe) * 0.5) + start * ((safe + unsafe) * 0.5); - tracebox(pos, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), pos, MOVE_NOMONSTERS, NULL); + tracebox(pos, PL_MIN_CONST, PL_MAX_CONST, pos, MOVE_NOMONSTERS, NULL); if (trace_startsolid) { if ((safe + unsafe) * 0.5 == unsafe) break; @@ -1560,7 +1560,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, STAT(PL_MIN, NULL) + '0.1 0.1 0.1', STAT(PL_MAX, NULL) - '0.1 0.1 0.1', p, MOVE_NOMONSTERS, NULL); + tracebox(p, PL_MIN_CONST + '0.1 0.1 0.1', PL_MAX_CONST - '0.1 0.1 0.1', p, MOVE_NOMONSTERS, NULL); 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; @@ -1574,7 +1574,7 @@ void GameCommand_trace(float request, float argc) { q = p + normalize(end - p) * (dq + dqf); if (q == q0) break; - tracebox(p, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), q, MOVE_NOMONSTERS, NULL); + tracebox(p, PL_MIN_CONST, PL_MAX_CONST, q, MOVE_NOMONSTERS, NULL); if (trace_startsolid) error("THIS ONE cannot happen"); if (trace_fraction > 0) dq += dqf * trace_fraction; dqf *= 0.5; diff --git a/qcsrc/server/impulse.qc b/qcsrc/server/impulse.qc index 8a10a6d75..9b36010fe 100644 --- a/qcsrc/server/impulse.qc +++ b/qcsrc/server/impulse.qc @@ -554,7 +554,7 @@ IMPULSE(navwaypoint_unreachable) IL_EACH(g_spawnpoints, true, { vector org = it.origin; - tracebox(it.origin, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), it.origin - '0 0 512', MOVE_NOMONSTERS, NULL); + tracebox(it.origin, PL_MIN_CONST, PL_MAX_CONST, it.origin - '0 0 512', MOVE_NOMONSTERS, NULL); setorigin(it, trace_endpos); if (navigation_findnearestwaypoint(it, false)) { diff --git a/qcsrc/server/mutators/mutator/gamemode_keyhunt.qc b/qcsrc/server/mutators/mutator/gamemode_keyhunt.qc index 2aede9204..5bfbe676e 100644 --- a/qcsrc/server/mutators/mutator/gamemode_keyhunt.qc +++ b/qcsrc/server/mutators/mutator/gamemode_keyhunt.qc @@ -277,7 +277,7 @@ void kh_Key_Detach(entity key) // runs every time a key is dropped or lost. Runs } // in any case: setattachment(key, NULL, ""); - setorigin(key, key.owner.origin + '0 0 1' * (STAT(PL_MIN, NULL).z - KH_KEY_MIN_z)); + setorigin(key, key.owner.origin + '0 0 1' * (STAT(PL_MIN, key.owner).z - KH_KEY_MIN_z)); key.angles = key.owner.angles; #else setorigin(key, key.owner.origin + key.origin.z * '0 0 1'); diff --git a/qcsrc/server/portals.qc b/qcsrc/server/portals.qc index 12083e423..1656b1400 100644 --- a/qcsrc/server/portals.qc +++ b/qcsrc/server/portals.qc @@ -208,8 +208,8 @@ float Portal_FindSafeOrigin(entity portal) { vector o; o = portal.origin; - portal.mins = STAT(PL_MIN, NULL) - SAFERNUDGE; - portal.maxs = STAT(PL_MAX, NULL) + SAFERNUDGE; + portal.mins = PL_MIN_CONST - SAFERNUDGE; + portal.maxs = PL_MAX_CONST + SAFERNUDGE; fixedmakevectors(portal.mangle); portal.origin += 16 * v_forward; if(!move_out_of_solid(portal)) diff --git a/qcsrc/server/race.qc b/qcsrc/server/race.qc index 87776d479..a3cbc685f 100644 --- a/qcsrc/server/race.qc +++ b/qcsrc/server/race.qc @@ -913,7 +913,7 @@ spawnfunc(trigger_race_checkpoint) settouch(this, checkpoint_touch); o = (this.absmin + this.absmax) * 0.5; - tracebox(o, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), o - '0 0 1' * (o.z - this.absmin.z), MOVE_NORMAL, this); + tracebox(o, PL_MIN_CONST, PL_MAX_CONST, o - '0 0 1' * (o.z - this.absmin.z), MOVE_NORMAL, this); waypoint_spawnforitem_force(this, trace_endpos); this.nearestwaypointtimeout = time + 1000000000; @@ -972,7 +972,7 @@ spawnfunc(target_checkpoint) // defrag entity if(is_trigger) { org = (this.absmin + this.absmax) * 0.5; - tracebox(org, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), org - '0 0 1' * (org.z - this.absmin.z), MOVE_NORMAL, this); + tracebox(org, PL_MIN_CONST, PL_MAX_CONST, org - '0 0 1' * (org.z - this.absmin.z), MOVE_NORMAL, this); waypoint_spawnforitem_force(this, trace_endpos); this.nearestwaypointtimeout = time + 1000000000; } -- 2.39.2