Skip to content

Fix #5168: Monster truck body lighting flickers when pushed - #5397

Open
iManGaaX wants to merge 2 commits into
multitheftauto:masterfrom
iManGaaX:resolve/issue-5168
Open

iManGaaX wants to merge 2 commits into
multitheftauto:masterfrom
iManGaaX:resolve/issue-5168

Conversation

@iManGaaX

Copy link
Copy Markdown
Contributor

Summary

Monster truck body lighting flickers between bright and dim when a player pushes the truck

ped-vs-wheel collisions write extreme lighting values (0x00 or 0xFF) to the per-wheel lighting bytes, which alternate with the ground value (0xBB) every frame - the visible flicker; the engine also resets the wheel bytes to a dim default (0x48) on respawn, so the body starts dark until the first ground collision

Fix: two hooks

  1. CMonsterTruck::ProcessEntityCollision; skip writing 0x00 and 0xFF to the wheel lighting byte, so only real ground/surface lighting (0x40-0xE0) updates it

  2. CVehicle::PreRender; clamp the final m_fLighting to a minimum of 0.36 (0xBB asphalt) for monster trucks, so the body is never darker than the ground it stands on, from the moment it spawns

Both hooks are scoped to monster trucks (444, 556, 557)

Closes #5168.

Before ->

2026-09-14.05-47-59.mp4

After ->

2026-09-14.05-44-01.mp4

Checklist

  • Your code should follow the coding guidelines.
  • Smaller pull requests are easier to review. If your pull request is beefy, your pull request should be reviewable commit-by-commit.

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.

Monster Truck lighting flickers

1 participant