Skip to content

Conversation

@FileEX
Copy link
Member

@FileEX FileEX commented Nov 13, 2025

Fix #3233

This PR is an improved version of #3837 - it’s not based on SilentPatch but on the original SA code. Additionally, the PR introduces a new special world property, vehicles_vanilla_dirt, which defaults to false to avoid breaking backward compatibility like in the previous PR (#3894, #3893). The setVehicleDirtLevel function only works if vehicles_vanilla_dirt is set to true.

The PR uses a minimal number of hooks and is based on a clean approach, implementing the GTA function directly (other functions will be reversed later to keep this PR as small as possible).

@FileEX FileEX added enhancement New feature or request bugfix Solution to a bug of any kind labels Nov 13, 2025
@FileEX FileEX requested a review from a team as a code owner January 17, 2026 19:52
Copy link
Member

@qaisjp qaisjp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a full code review, but I have a question

Instead of a special world property, why not just enable the patch when someone calls setVehicleDirtLevel for the first time?

Or is the case that this code does more than just make setVehicleDirtLevel work?

Comment on lines +134 to +141
_asm
{
mov eax, [esp+8]
push eax
call CVehicleModelInfoSAInterface::SetClump
add esp, 4
retn 4
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to rewrite this to not use __asm?

GitHub Copilot says this:

// Assuming SetClump takes a single pointer argument and uses cdecl
using SetClumpFn = void(__cdecl*)(void*);

void ForwardSetClump(void* arg)
{
    const auto fn = reinterpret_cast<SetClumpFn>(&CVehicleModelInfoSAInterface::SetClump);
    fn(arg);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Solution to a bug of any kind enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix setVehicleDirtLevel

2 participants