Skip to content

Commit

Permalink
Fix more vehicle crash
Browse files Browse the repository at this point in the history
  • Loading branch information
TheNormalnij committed Apr 14, 2024
1 parent a192fe3 commit 5d366b9
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Client/game_sa/CBuildingsPoolSA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -315,9 +315,16 @@ void CBuildingsPoolSA::RemoveVehicleDamageLinks()
const int count = pGame->GetPools()->GetVehicleCount();
for (int i = 0; i < count; i++)
{
auto* vehicle = pGame->GetPools()->GetVehicle(i);
auto* vehLinks = pGame->GetPools()->GetVehicle(i);
if (vehLinks->pEntity)
{
vehicle->pEntity->GetVehicleInterface()->m_pCollidedEntity = nullptr;
CVehicleSAInterface* vehicle = vehLinks->pEntity->GetVehicleInterface();
vehicle->m_pCollidedEntity = nullptr;
vehicle->pLastContactedEntity[0] = nullptr;
vehicle->pLastContactedEntity[1] = nullptr;
vehicle->pLastContactedEntity[2] = nullptr;
vehicle->pLastContactedEntity[3] = nullptr;
vehicle->m_ucCollisionState = 0;
}
}
}
Expand Down

0 comments on commit 5d366b9

Please sign in to comment.