Fix exiting vehicles
authorMario <mario@smbclan.net>
Tue, 24 Jan 2017 22:59:33 +0000 (08:59 +1000)
committerMario <mario@smbclan.net>
Tue, 24 Jan 2017 22:59:33 +0000 (08:59 +1000)
qcsrc/common/vehicles/sv_vehicles.qc
qcsrc/common/vehicles/vehicle/bumblebee.qc
qcsrc/common/vehicles/vehicle/racer.qc
qcsrc/common/vehicles/vehicle/raptor.qc
qcsrc/common/vehicles/vehicle/spiderbot.qc

index 4e4bfd5..e8ab69a 100644 (file)
@@ -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;
        }
index 01edce6..69d7dbf 100644 (file)
@@ -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))
index 7af872e..b972f8a 100644 (file)
@@ -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);
index 838376e..7bbc39e 100644 (file)
@@ -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);
index d395324..7634e76 100644 (file)
@@ -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);