Some fixes/checks for prop_dynamic that I forgot to revert while testing.
Also added some changes to NSVehicle/prop_vehicle_drivable.
This commit is contained in:
parent
54cf7f8273
commit
4c6800aa4f
3 changed files with 10 additions and 5 deletions
|
@ -43,12 +43,9 @@ prop_dynamic::Respawn(void)
|
||||||
{
|
{
|
||||||
super::Respawn();
|
super::Respawn();
|
||||||
SetModel(GetSpawnModel());
|
SetModel(GetSpawnModel());
|
||||||
//UpdateBounds();
|
|
||||||
|
|
||||||
if (spawnflags & PRPDYN_NONSOLID)
|
if (spawnflags & PRPDYN_NONSOLID)
|
||||||
SetSolid(SOLID_NOT);
|
SetSolid(SOLID_NOT);
|
||||||
|
|
||||||
SetSolid(SOLID_BBOX);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -200,6 +200,9 @@ NSVehicle::PlayerEnter(base_player pl)
|
||||||
{
|
{
|
||||||
vector offs;
|
vector offs;
|
||||||
|
|
||||||
|
if (!pl)
|
||||||
|
return;
|
||||||
|
|
||||||
/* cache the position */
|
/* cache the position */
|
||||||
offs = pl.origin - origin;
|
offs = pl.origin - origin;
|
||||||
|
|
||||||
|
@ -218,6 +221,9 @@ NSVehicle::PlayerEnter(base_player pl)
|
||||||
void
|
void
|
||||||
NSVehicle::PlayerLeave(base_player pl)
|
NSVehicle::PlayerLeave(base_player pl)
|
||||||
{
|
{
|
||||||
|
if (!pl)
|
||||||
|
return;
|
||||||
|
|
||||||
pl.movetype = MOVETYPE_WALK;
|
pl.movetype = MOVETYPE_WALK;
|
||||||
pl.flags &= ~FL_INVEHICLE;
|
pl.flags &= ~FL_INVEHICLE;
|
||||||
|
|
||||||
|
|
|
@ -242,8 +242,11 @@ prop_vehicle_driveable_wheel::Accel(float flMoveTime, float m_flTurn)
|
||||||
makevectors(vecAngle);
|
makevectors(vecAngle);
|
||||||
|
|
||||||
if (m_flTurn) {
|
if (m_flTurn) {
|
||||||
|
/* cripple turnrate by our current velocity */
|
||||||
|
float turnbreak = bound(0, vlen(velocity), 100) * 0.5;
|
||||||
|
|
||||||
/* rotates v_forward */
|
/* rotates v_forward */
|
||||||
rotatevectorsbyangle([ 0, m_flTurn * 50, 0]);
|
rotatevectorsbyangle([ 0, m_flTurn * turnbreak, 0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
tracebox(origin, mins, maxs, origin - v_up, MOVE_NOMONSTERS, owner);
|
tracebox(origin, mins, maxs, origin - v_up, MOVE_NOMONSTERS, owner);
|
||||||
|
@ -405,7 +408,6 @@ prop_vehicle_driveable::RunVehiclePhysics(void)
|
||||||
angles[0] = bound(-45, angles[0], 45);
|
angles[0] = bound(-45, angles[0], 45);
|
||||||
angles[2] = bound(-45, angles[2], 45);
|
angles[2] = bound(-45, angles[2], 45);
|
||||||
|
|
||||||
|
|
||||||
velocity[0] = bound(-1000, velocity[0], 1000);
|
velocity[0] = bound(-1000, velocity[0], 1000);
|
||||||
velocity[1] = bound(-1000, velocity[1], 1000);
|
velocity[1] = bound(-1000, velocity[1], 1000);
|
||||||
velocity[2] = bound(-1000, velocity[2], 1000);
|
velocity[2] = bound(-1000, velocity[2], 1000);
|
||||||
|
|
Loading…
Reference in a new issue