Skip to content

tweak(five): patch carcols sirensettings allowing for 16bit values #3314

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

Conversation

d22tny
Copy link
Contributor

@d22tny d22tny commented Apr 4, 2025

Goal of this PR

Adjust from 8-bit to 16-bit carcols/sirensettings values to go beyond 255. Fixing servers that have reached more than 255 emergency vehicles in regards to conflicting carcols ID values.

This value is located in carcols.meta under as well as carvariations.meta and is currently an 8-bit value thus limiting people to only 255 unique values.

This PR just has a slightly better formatting than #3273 and #3313

I did not compile and test the code.

For a quicker check on what happens to sync-trees, this is the change:

image

...

How is this PR achieving the goal

I think trying to patch the size of the sirensettings?!
...

This PR applies to the following area(s)

...

Successfully tested on

Not tested
Game builds: ..

Platforms: Windows, Linux

Checklist

  • Code compiles and has been tested successfully.
  • Code explains itself well and/or is documented.
  • My commit message explains what the changes do and what they are for.
  • No extra compilation warnings are added by these changes.

Fixes issues

#2612

@github-actions github-actions bot added the triage Needs a preliminary assessment to determine the urgency and required action label Apr 4, 2025
@Nobelium-cfx
Copy link
Contributor

The reason why diff in SyncTrees_Five.h is still huge seems to be because end line symbol has changed. This file has a mix of \n and \r\n. When you open it in most editors - the editor will unify all the enlines. That's where the diff comes from.

There are two ways of dealing with this problem:

  • Add only the lines that were actually changed through git add -p
  • Make a commit that unifies endlines in this file. Make the actual changes as a separate followup commit.

Comment on lines -62 to +77
{ { "66 3B F0 73 ? 48 8D", 8 },
{ "66 41 3B C0 73 ? 48 8D", 9 },
{ "45 33 C0 4C 8D 0D ? ? ? ? B9", 6 },
{ "B8 FF FF 00 00 48 8D 3D", 8 },
{ "7D ? 41 BC FF FF 00 00 4C 8D 3D", 11 } });
{ { "66 3B F0 66 73 ?? 48 8D", 8 }, // Adjusted to 16-bit search: 66 3B F0 66 73 ?? 48 8D
{ "66 41 3B C0 66 73 ?? 48 8D", 9 }, // Adjusted to 16-bit search: 66 41 3B C0 66 73 ?? 48 8D
{ "45 33 C0 4C 8D 0D ?? ?? ?? ?? B9", 6 }, // Adjusted for 16-bit match (??)
{ "66 B8 FF FF 00 00 48 8D 3D", 8 }, // Adjusted to 16-bit search: 66 B8 FF FF 00 00 48 8D 3D
{ "7D ?? 41 BC FF FF 00 00 4C 8D 3D", 11 } }); // Adjusted for 16-bit match (??)
RelocateAbsolute(
{ { "66 3B D1 73 ? 8B C2", 11 },
{ "66 39 4B 2A 73 ? 0F", 14 } });
hook::nop(hook::get_pattern("66 3B F0 73 ? 48 8D", 0), 5);
hook::nop(hook::get_pattern("66 41 3B C0 73 ? 48 8D", 0), 6);
hook::nop(hook::get_pattern("66 3B D1 73 ? 8B C2", 0), 5);
hook::nop(hook::get_pattern("66 39 4B 2A 73 ? 0F", 0), 6);
{ { "66 3B D1 66 73 ?? 8B C2", 11 }, // Adjusted to 16-bit search: 66 3B D1 66 73 ?? 8B C2
{ "66 39 4B 2A 66 73 ?? 0F", 14 } }); // Adjusted to 16-bit search: 66 39 4B 2A 66 73 ?? 0F
hook::nop(hook::get_pattern("66 3B F0 66 73 ?? 48 8D", 0), 5);
hook::nop(hook::get_pattern("66 41 3B C0 66 73 ?? 48 8D", 0), 6);
hook::nop(hook::get_pattern("66 3B D1 66 73 ?? 8B C2", 0), 5);
hook::nop(hook::get_pattern("66 39 4B 2A 66 73 ?? 0F", 0), 6);
hook::nop(hook::get_pattern("41 81 F8 00 04 00 00 7C", 0), 9);

{
auto location = hook::get_pattern("B8 FF FF 00 00 48 8D 3D", 13);
auto location = hook::get_pattern("66 B8 FF FF 00 00 48 8D 3D", 13);
Copy link
Contributor

@tens0rfl0w tens0rfl0w Apr 21, 2025

Choose a reason for hiding this comment

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

Most changed patterns seem to be invalid, not too sure if that's the right approach for patching this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Most changed patterns seem to be invalid, not too sure if that's the right approach for patching this.

that's what i thought of it as well, at this time there are 3 PR's with the same idea, i opened this to try and help see the better formatting, i didn't know if i should let the mixed line ends, that's why i added a unify with the mostly used one.

as i've said i didn't compile anything, i didn't test it, i just helped with formatting in a way that all line ends are the same and it doesn't change the entire file.

@d22tny
Copy link
Contributor Author

d22tny commented Apr 21, 2025

Hey @Nobelium-cfx , i just tried to help with the formatting, as i've explained into tens0rfl0w's review.
In my opinion, all 3 PR's regarding this should be closed and maybe someone with a little bit more experience into reverse engineering takes a look at it ?

@d22tny d22tny closed this Apr 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage Needs a preliminary assessment to determine the urgency and required action
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants