From: Mario Date: Tue, 24 Jan 2017 22:59:33 +0000 (+1000) Subject: Fix exiting vehicles X-Git-Tag: xonotic-v0.8.2~274 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a691e2eb06929b85250f8ae4d0d4700cd848b0b6;p=xonotic%2Fxonotic-data.pk3dir.git Fix exiting vehicles --- diff --git a/qcsrc/common/vehicles/sv_vehicles.qc b/qcsrc/common/vehicles/sv_vehicles.qc index 4e4bfd584..e8ab69a30 100644 --- a/qcsrc/common/vehicles/sv_vehicles.qc +++ b/qcsrc/common/vehicles/sv_vehicles.qc @@ -737,10 +737,10 @@ void vehicles_impact(entity this, float _minspeed, float _speedfac, float _maxpa } // vehicle enter/exit handling -vector vehicles_findgoodexit(entity this, vector prefer_spot) +vector vehicles_findgoodexit(entity this, entity player, vector prefer_spot) { // 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); + tracebox(this.origin + '0 0 32', PL_MIN_CONST, PL_MAX_CONST, prefer_spot, MOVE_NORMAL, player); if(trace_fraction == 1.0 && !trace_startsolid && !trace_allsolid) return prefer_spot; @@ -752,7 +752,7 @@ vector vehicles_findgoodexit(entity this, vector prefer_spot) v = randomvec(); v_z = 0; v = v2 + normalize(v) * mysize; - tracebox(v2, PL_MIN_CONST, PL_MAX_CONST, v, MOVE_NORMAL, this.owner); + tracebox(v2, PL_MIN_CONST, PL_MAX_CONST, v, MOVE_NORMAL, player); if(trace_fraction == 1.0 && !trace_startsolid && !trace_allsolid) return v; } diff --git a/qcsrc/common/vehicles/vehicle/bumblebee.qc b/qcsrc/common/vehicles/vehicle/bumblebee.qc index 01edce67a..69d7dbf89 100644 --- a/qcsrc/common/vehicles/vehicle/bumblebee.qc +++ b/qcsrc/common/vehicles/vehicle/bumblebee.qc @@ -656,7 +656,7 @@ void bumblebee_exit(entity this, int eject) else spot = this.origin + v_up * 128 - v_forward * 300; - spot = vehicles_findgoodexit(this, spot); + spot = vehicles_findgoodexit(this, this.owner, spot); // Hide beam if(this.gun3.enemy || !wasfreed(this.gun3.enemy)) diff --git a/qcsrc/common/vehicles/vehicle/racer.qc b/qcsrc/common/vehicles/vehicle/racer.qc index 7af872efd..b972f8aaf 100644 --- a/qcsrc/common/vehicles/vehicle/racer.qc +++ b/qcsrc/common/vehicles/vehicle/racer.qc @@ -426,7 +426,7 @@ void racer_exit(entity this, int eject) if(eject) { spot = this.origin + v_forward * 100 + '0 0 64'; - spot = vehicles_findgoodexit(this, spot); + spot = vehicles_findgoodexit(this, this.owner, spot); setorigin(this.owner, spot); this.owner.velocity = (v_up + v_forward * 0.25) * 750; this.owner.oldvelocity = this.owner.velocity; @@ -438,14 +438,14 @@ void racer_exit(entity this, int eject) this.owner.velocity = normalize(this.velocity) * autocvar_sv_maxairspeed * 2; this.owner.velocity_z += 200; spot = this.origin + v_forward * 32 + '0 0 32'; - spot = vehicles_findgoodexit(this, spot); + spot = vehicles_findgoodexit(this, this.owner, spot); } else { this.owner.velocity = this.velocity * 0.5; this.owner.velocity_z += 10; spot = this.origin - v_forward * 200 + '0 0 32'; - spot = vehicles_findgoodexit(this, spot); + spot = vehicles_findgoodexit(this, this.owner, spot); } this.owner.oldvelocity = this.owner.velocity; setorigin(this.owner , spot); diff --git a/qcsrc/common/vehicles/vehicle/raptor.qc b/qcsrc/common/vehicles/vehicle/raptor.qc index 838376e51..7bbc39e89 100644 --- a/qcsrc/common/vehicles/vehicle/raptor.qc +++ b/qcsrc/common/vehicles/vehicle/raptor.qc @@ -102,7 +102,7 @@ void raptor_exit(entity this, int eject) if(eject) { spot = this.origin + v_forward * 100 + '0 0 64'; - spot = vehicles_findgoodexit(this, spot); + spot = vehicles_findgoodexit(this, player, spot); setorigin(player, spot); player.velocity = (v_up + v_forward * 0.25) * 750; player.oldvelocity = player.velocity; @@ -114,14 +114,14 @@ void raptor_exit(entity this, int eject) player.velocity = normalize(this.velocity) * autocvar_sv_maxairspeed * 2; player.velocity_z += 200; spot = this.origin + v_forward * 32 + '0 0 64'; - spot = vehicles_findgoodexit(this, spot); + spot = vehicles_findgoodexit(this, player, spot); } else { player.velocity = this.velocity * 0.5; player.velocity_z += 10; spot = this.origin - v_forward * 200 + '0 0 64'; - spot = vehicles_findgoodexit(this, spot); + spot = vehicles_findgoodexit(this, player, spot); } player.oldvelocity = player.velocity; setorigin(player, spot); diff --git a/qcsrc/common/vehicles/vehicle/spiderbot.qc b/qcsrc/common/vehicles/vehicle/spiderbot.qc index d395324b0..7634e7680 100644 --- a/qcsrc/common/vehicles/vehicle/spiderbot.qc +++ b/qcsrc/common/vehicles/vehicle/spiderbot.qc @@ -340,7 +340,7 @@ void spiderbot_exit(entity this, int eject) if(eject) { spot = this.origin + v_forward * 100 + '0 0 64'; - spot = vehicles_findgoodexit(this, spot); + spot = vehicles_findgoodexit(this, player, spot); setorigin(player, spot); player.velocity = (v_up + v_forward * 0.25) * 750; player.oldvelocity = player.velocity; @@ -352,14 +352,14 @@ void spiderbot_exit(entity this, int eject) player.velocity = normalize(this.velocity) * vlen(this.velocity); player.velocity_z += 200; spot = this.origin + v_forward * 128 + '0 0 64'; - spot = vehicles_findgoodexit(this, spot); + spot = vehicles_findgoodexit(this, player, spot); } else { player.velocity = this.velocity * 0.5; player.velocity_z += 10; spot = this.origin + v_forward * 256 + '0 0 64'; - spot = vehicles_findgoodexit(this, spot); + spot = vehicles_findgoodexit(this, player, spot); } player.oldvelocity = player.velocity; setorigin(player, spot);