Skip to content

Commit

Permalink
Fix CVehicleSA::BlowUp crash (#4058)
Browse files Browse the repository at this point in the history
Fix BlowUp crash
  • Loading branch information
TheNormalnij authored Mar 1, 2025
1 parent 40d9ac1 commit d77f6f8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Client/game_sa/CVehicleSA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1123,7 +1123,7 @@ CDamageManager* CVehicleSA::GetDamageManager()

void CVehicleSA::BlowUp(CEntity* pCreator, unsigned long ulUnknown)
{
GetVehicleInterface()->BlowUpCar(pCreator->GetInterface(), ulUnknown);
GetVehicleInterface()->BlowUpCar(pCreator ? pCreator->GetInterface() : nullptr, ulUnknown);
}

void CVehicleSA::FadeOut(bool bFadeOut)
Expand Down
2 changes: 1 addition & 1 deletion Client/mods/deathmatch/logic/CClientVehicle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -908,7 +908,7 @@ void CClientVehicle::Blow(VehicleBlowFlags blow)
// "Fuck" the car completely, so we don't have weird client-side jumpyness because of differently synced wheel states on clients
FuckCarCompletely(true);

m_pVehicle->BlowUp(NULL, 0);
m_pVehicle->BlowUp(nullptr, 0);

// Blowing up a vehicle will cause an explosion in the original game code, but we have a hook in place,
// which will prevent the explosion and forward the information to the server to relay it to everyone from there.
Expand Down

0 comments on commit d77f6f8

Please sign in to comment.