Fixed m_fMaxSpeed being always set to 250

This commit is contained in:
smallmodel 2024-02-18 20:10:18 +01:00
parent a770df1e0b
commit 5521cf9ab3
No known key found for this signature in database
GPG key ID: 9F2D623CEDF08512

View file

@ -3375,7 +3375,7 @@ void Vehicle::EventDriveInternal(Event *ev, bool wait)
m_fLookAhead = 256; m_fLookAhead = 256;
m_fIdealAccel = 35; m_fIdealAccel = 35;
m_fIdealSpeed = 250; m_fIdealSpeed = 250;
m_fMaxSpeed = 250; m_fMaxSpeed = 250; // Added in 2.30
switch (ev->NumArgs()) { switch (ev->NumArgs()) {
case 6: case 6:
@ -3388,6 +3388,7 @@ void Vehicle::EventDriveInternal(Event *ev, bool wait)
m_fIdealAccel = ev->GetFloat(3); m_fIdealAccel = ev->GetFloat(3);
case 2: case 2:
m_fIdealSpeed = ev->GetFloat(2); m_fIdealSpeed = ev->GetFloat(2);
m_fMaxSpeed = m_fIdealSpeed;// Added in 2.30
case 1: case 1:
path = ev->GetSimpleEntity(1); path = ev->GetSimpleEntity(1);
if (!path) { if (!path) {
@ -4088,21 +4089,22 @@ void Vehicle::SlidePush(Vector vPush)
if (j == i && other->entity) { if (j == i && other->entity) {
other->entity->CheckGround(); other->entity->CheckGround();
if (other->entity->groundentity if (other->entity->groundentity) {
&& (other->entity->groundentity == edict || other->entity == m_pCollisionEntity)) { if (other->entity->groundentity == edict || m_pCollisionEntity && other->entity->groundentity->entity == m_pCollisionEntity) {
// save the entity // save the entity
pSkippedEntities[iNumSkipped] = other->entity; pSkippedEntities[iNumSkipped] = other->entity;
iContentsEntities[iNumSkipped] = other->r.contents; iContentsEntities[iNumSkipped] = other->r.contents;
solidEntities[iNumSkipped] = other->solid; solidEntities[iNumSkipped] = other->solid;
iNumSkipped++; iNumSkipped++;
if (iNumSkipped >= MAX_SKIPPED_ENTITIES) { if (iNumSkipped >= MAX_SKIPPED_ENTITIES) {
gi.Error(ERR_DROP, "MAX_SKIPPED_ENTITIES hit in VehicleMove.\n"); gi.Error(ERR_DROP, "MAX_SKIPPED_ENTITIES hit in VehicleMove.\n");
return; return;
}
other->entity->setSolidType(SOLID_NOT);
iNumSkippedEntities++;
} }
other->entity->setSolidType(SOLID_NOT);
iNumSkippedEntities++;
} }
if (g_showvehiclemovedebug->integer) { if (g_showvehiclemovedebug->integer) {