prop_vehicle_drivable: Add spawnflag VEHSF_NOFLIP, which will prevent the vehicle from flipping over

This commit is contained in:
Marco Cawthorne 2022-05-26 17:42:35 -07:00
parent 50070b031b
commit 0f7d4fd214
Signed by: eukara
GPG Key ID: CE2032F0A2882A22
1 changed files with 7 additions and 0 deletions

View File

@ -32,6 +32,8 @@ This entity was introduced in Half-Life 2 (2004).
#define VEH_SKIDDING FL_USE_RELEASED
#define VEHSF_NOFLIP 2048
enumflags
{
VEHFL_DRIVER,
@ -579,6 +581,11 @@ prop_vehicle_driveable::RunVehiclePhysics(void)
PlayerUpdateFlags();
}
if (spawnflags & VEHSF_NOFLIP) {
angles[0] = bound (-45, angles[0], 45);
angles[2] = bound (-45, angles[2], 45);
}
flags &= ~VEH_SKIDDING;
angles[0] = Math_FixDelta(angles[0]);