Skip to content

Various bug fixes#354

Merged
a1batross merged 25 commits into
mainfrom
fixes
May 22, 2026
Merged

Various bug fixes#354
a1batross merged 25 commits into
mainfrom
fixes

Conversation

@a1batross
Copy link
Copy Markdown
Collaborator

There are three kinds of bug fixes: off-by-one errors, possible OOB reads/writes and format string fixes.

It also finally implements VGUI2 style formatter, so we don't have to carry StripIndices hack anymore.

@a1batross
Copy link
Copy Markdown
Collaborator Author

cc @Vladislav4KZ

@Vladislav4KZ
Copy link
Copy Markdown
Contributor

Wow, that's quite a large PR.

Thank you for your work, and sorry for the delay.

I noticed both positive and negative aspects in this PR.
The rebuy command now works in MainUI when using touch input, but another bug has appeared instead.
More details are in the review comments.

@a1batross
Copy link
Copy Markdown
Collaborator Author

Wow, that's quite a large PR.

Yeah, sorry, I thought to split it but decided 400 lines diff isn't a lot. :D

More details are in the review comments.

Yep, going through them.

@a1batross
Copy link
Copy Markdown
Collaborator Author

More details are in the review comments.

Yep, going through them.

But there are none.

@Vladislav4KZ
Copy link
Copy Markdown
Contributor

But there are none.

???
image
image

@a1batross
Copy link
Copy Markdown
Collaborator Author

a1batross commented May 22, 2026

@Vladislav4KZ yeah, that's GitHub review thing. When you leave a bunch of comments, you need to press a button on top right, select the action (comment/approve/request changes) and only then all your comments will be visible.

Comment thread cl_dll/saytext.cpp Outdated
"#Cstrike_Chat_T_Loc",
"\x03*(Terrorist) %s @ %s : \x01%s",
3, true, true, true
"\x03*(Terrorist) %s1 @ %s2 : \x01%s3",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The argument order is wrong here.
It should be:

"\x03*(Terrorist) %s1 @ %s3 : \x01%s2",

The localization files already use this argument order:

"Cstrike_Chat_CT_Loc"				"�(Counter-Terrorist) �%s1� @ �%s3� :  %s2"
"Cstrike_Chat_T_Loc"				"�(Terrorist) �%s1� @ �%s3� :  %s2"

See: https://github.com/rehlds/ReGameDLL_CS/blob/781a68ae1c6fb652cf4fbc894970b4fb4dde19f9/regamedll/dlls/client.cpp#L1066-L1077

WRITE_STRING(pszFormat) - format string
WRITE_STRING("") - empty first argument
WRITE_STRING(text) - second argument
WRITE_STRING(placeName) - third argument

So:
%s1 is the player name
%s2 is the chat text
%s3 is the location name

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

But do we actually need that? Because it seems it was added as a fallback back when I didn't added localization files parser.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

If not, I will just copy it from localization files, maybe that can be removed later.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Right now this is causing a bug where the location name overlaps the team name using the chat message text color, and the chat message text is rendered in the team color.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Ok, lemme fix it real quick then.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in 9647869

Comment thread cl_dll/saytext.cpp Outdated
"#Cstrike_Chat_CT_Loc",
"\x03*(Counter-Terrorist) %s @ %s : \x01%s",
3, true, true, true
"\x03*(Counter-Terrorist) %s1 @ %s2 : \x01%s3",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same as I mentioned above.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed 9647869

@Vladislav4KZ
Copy link
Copy Markdown
Contributor

I left review comments using GitHub Mobile, and for some reason I didn’t see the “Finish review” button.

Comment thread cl_dll/saytext.cpp Outdated
"\x03* %s1 changed name to %s2",
2, true
},
// VGUI2 indexed args: location is %s2, message is %s3 — natural order.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this comment is no longer relevant.

@a1batross a1batross merged commit 75526c4 into main May 22, 2026
18 checks passed
@a1batross a1batross deleted the fixes branch May 22, 2026 19:38
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.

2 participants