Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GTA SA] Certain .dat files support is broken #123

Open
TheComputerGuy96 opened this issue Dec 30, 2024 · 0 comments
Open

[GTA SA] Certain .dat files support is broken #123

TheComputerGuy96 opened this issue Dec 30, 2024 · 0 comments

Comments

@TheComputerGuy96
Copy link

TheComputerGuy96 commented Dec 30, 2024

There's two Win32 API calls to SetCurrentDirectory() (one sets the directory to data directory in the game's root folder and the other resets the directory back to the game root) likely done by the game itself when the car/ped group (or time cycle) .dat functions are called

This dance causes Modloader's path translator to use the wrong current directory when generating the file paths (which leads to broken paths outside of the game's normal path); this behavior is noticeable in an extra islands mod where the game crashes once you approach the new islands (that's because the custom ped*.dat/car*.dat/timec*.dat files are being loaded at that time and they couldn't be found)

Also the mod mentioned above puts the car*.dat/ped*.dat/timec*.dat files inside of the main game's data directory because of that bug (which isn't ideal because it pollutes the game's main files a bit)

I can think of two solutions for this:

  1. Patching the game's relevant functions to remove the SetCurrentDirectory() dance and use a game root-relative path (this shouldn't be too bad because the mod only supports very specific GTA SA versions)
  2. Adding a special path workaround for data current directories (this might be too hacky though)
@TheComputerGuy96 TheComputerGuy96 changed the title [GTA SA] Custom group .dat files support is broken [GTA SA] Certain .dat files support is broken Dec 31, 2024
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

No branches or pull requests

1 participant