Add ability to enable/disable vehicle model hierarchy typo fixes#4918
Open
SpeedyFolf wants to merge 6 commits into
Open
Add ability to enable/disable vehicle model hierarchy typo fixes#4918SpeedyFolf wants to merge 6 commits into
SpeedyFolf wants to merge 6 commits into
Conversation
Introduce an optional SilentPatch-style fix that matches canonical vehicle component names to typo'd hierarchy nodes in stock DFF files. Adds CMultiplayer API methods (Set/GetVehicleHierarchyTypoFixesEnabled) and CMultiplayerSA overrides, a new implementation file that hooks the stricmp call used during CVehicleModelInfo setup with a small mapping table, and initializes the hook from the vehicle init. Exposes Lua bindings (engineSet/GetVehicleHierarchyTypoFixesEnabled and Engine.set/getVehicleHierarchyTypoFixesEnabled) and ensures the feature is disabled by default during ResetWorldProperties to preserve vanilla behaviour.
People can just be responsible and disable this themselves when their map ends like the fastsprint "glitch".
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an opt-in clientside fix (SilentPatch-style) so GTA can match canonical vehicle component names from handling/IDE to typo'd frame names in stock
.dffhierarchies (e.g.wheel_lmvswheel_lm_dummy,boat_movingvsboat_moving_hi, transmission / taillight / misc / elevator spellings). Disclaimer: This was created with assistance from Cursor, an AI coding tool.Implementation:
_stricmpcall site used duringCVehicleModelInfosetup (same approach as SilentPatch SA:0x4C5311), with a small sorted alias table.CMultiplayer/CMultiplayerSA:SetVehicleHierarchyTypoFixesEnabled/GetVehicleHierarchyTypoFixesEnabled(default off).CMultiplayerSA::InitHooks_Vehicles(newCMultiplayerSA_VehicleHierarchyTypoFixes.cpp).engineSetVehicleHierarchyTypoFixesEnabled,engineGetVehicleHierarchyTypoFixesEnabled, andEngine.set/getVehicleHierarchyTypoFixesEnabled.Motivation
Server/scripters today fix broken components (wheels, boat moving parts, lights, etc.) by shipping custom DFFs that only rename hierarchy nodes. That duplicates data and increases download size. Matching SilentPatch's optional behaviour in the client lets scripts enable the same matching without replacing models, while keeping vanilla behaviour for everyone else by default.
Test plan
engineGetVehicleHierarchyTypoFixesEnabled()is false; stock vehicles behave as before (no regression when unused).engineSetVehicleHierarchyTypoFixesEnabled(true)early (e.g.onClientResourceStart), then spawn/stream affected models - verify e.g. DFT-30 wheel, Predator/Tropic moving boat part, Dumper transmission dummies, Uranus taillights, Sweeper misc, Dodo elevator, etc., match expected fixed behaviour (same as my DFF-replace resource).engineRestreamModel(vehicleModelId)is used.crun:engineSetVehicleHierarchyTypoFixesEnabled(true)/falseand getters - console shows success.This is not reset in
ResetWorldProperties, just likesetGlitchEnabled()glitches; resources/maps should disable this when they're stopped like other opt-in client features.Checklist