Skip to content

fix(core): add null-guards for player ped and skip destroyed vehicles in script processing - #350

Merged
CanerKaraca23 merged 1 commit into
user-grinch:mainfrom
CanerKaraca23:fix/null-guards-destroyed-vehicles
Sep 22, 2026
Merged

CanerKaraca23 merged 1 commit into
user-grinch:mainfrom
CanerKaraca23:fix/null-guards-destroyed-vehicles

Conversation

@CanerKaraca23

Copy link
Copy Markdown
Collaborator

Summary

Adds defensive null-pointer guards for FindPlayerPed() and early-exit checks for destroyed vehicles (m_fHealth <= 0.0f) across lights, gauges, roof, and sound systems.

Changes

  • Guard FindPlayerPed() with pPlayer != nullptr before IsDriver() in headlight, fog light, indicator, roof, and sound effects.
  • Skip destroyed vehicles in loader.cpp script processing loop and all gauge render callbacks.
  • Add signed gear index bounds check in GearIndicator.

@CanerKaraca23
CanerKaraca23 merged commit 4fad92e into user-grinch:main Sep 22, 2026
1 check passed
@CanerKaraca23
CanerKaraca23 deleted the fix/null-guards-destroyed-vehicles branch September 22, 2026 23:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant