From: Mario Date: Tue, 24 Feb 2015 09:31:05 +0000 (+1100) Subject: Partial fix for players getting crushed when they exit gunner slot of bumblebee X-Git-Tag: xonotic-v0.8.2~2059^2~12 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=0f7a79b0f2892908628be703f1be8fc70691abbe;p=xonotic%2Fxonotic-data.pk3dir.git Partial fix for players getting crushed when they exit gunner slot of bumblebee --- diff --git a/qcsrc/common/vehicles/sv_vehicles.qc b/qcsrc/common/vehicles/sv_vehicles.qc index 557daaca48..ecc9066398 100644 --- a/qcsrc/common/vehicles/sv_vehicles.qc +++ b/qcsrc/common/vehicles/sv_vehicles.qc @@ -847,6 +847,7 @@ void vehicles_exit(float eject) _player.switchweapon = _vehicle.switchweapon; _player.last_vehiclecheck = time + 3; _player.vehicle_enter_delay = time + 2; + _player.spawnshieldtime = time + 0.5; // protect them long enough to escape the deadly vehicle CSQCVehicleSetup(_player, HUD_NORMAL); } @@ -903,7 +904,7 @@ void vehicles_touch() if((self.origin_z + self.maxs_z) > (other.origin_z)) if(vehicles_crushable(other)) { - if(vlen(self.velocity) != 0) + if(vlen(self.velocity) >= 30) Damage(other, self, self.owner, autocvar_g_vehicles_crush_dmg, DEATH_VH_CRUSH, '0 0 0', normalize(other.origin - self.origin) * autocvar_g_vehicles_crush_force); return; // Dont do selfdamage when hitting "soft targets". diff --git a/qcsrc/common/vehicles/unit/bumblebee.qc b/qcsrc/common/vehicles/unit/bumblebee.qc index ef02d6b839..598fcd7a7d 100644 --- a/qcsrc/common/vehicles/unit/bumblebee.qc +++ b/qcsrc/common/vehicles/unit/bumblebee.qc @@ -268,6 +268,7 @@ void bumblebee_gunner_exit(int _exitflag) player.teleportable = TELEPORT_NORMAL; player.switchweapon = gunner.switchweapon; player.vehicle_enter_delay = time + 2; + player.spawnshieldtime = time + 0.5; fixedmakevectors(vehic.angles); @@ -275,9 +276,10 @@ void bumblebee_gunner_exit(int _exitflag) if(player == vehic.gunner2) { vehic.gunner2 = world; v_right *= -1; } vector spot = real_origin(gunner); - spot += v_up * 128 + v_forward * 300 + v_right * 150; - spot = vehicles_findgoodexit(spot); - //setorigin(player, spot); + spot = spot + v_up * 128 + v_forward * 300 + v_right * 150; + spot = bumblebee_gunner_findgoodexit(spot, gunner, player); + + // TODO: figure a way to move player out of the gunner player.velocity = 0.75 * vehic.velocity + normalize(spot - vehic.origin) * 200; player.velocity_z += 10;