Skip to content

Always use our cached name value#1544

Merged
asherkin merged 1 commit intomasterfrom
bug-1315
Aug 2, 2021
Merged

Always use our cached name value#1544
asherkin merged 1 commit intomasterfrom
bug-1315

Conversation

@asherkin
Copy link
Member

In #545 we started automatically fixing up invalid UTF8 characters
caused by truncated names from Steam, but since the dawn of time CPlayer
has preferred directly returning the engine's name pointer if we have
once available, so our corrected name is almost never used.

Lightly tested in CS:GO and TF2 with no ill effects. Fixes #1315

In #545 we started automatically fixing up invalid UTF8 characters
caused by truncated names from Steam, but since the dawn of time CPlayer
has preferred directly returning the engine's name pointer if we have
once available, so our corrected name is almost never used.

Lightly tested in CS:GO and TF2 with no ill effects. Fixes #1315
@KyleSanderson
Copy link
Member

Can we return the engine value if our cache is invalid (and then store the result in our cache?).

@asherkin
Copy link
Member Author

asherkin commented Aug 1, 2021

I don't think there can ever be a point that the name isn't set - the previous code here was explicitly using it early when the engine player info wasn't available.

@asherkin asherkin merged commit b8c5303 into master Aug 2, 2021
@asherkin asherkin deleted the bug-1315 branch August 2, 2021 10:58
Copy link

@NotPowered NotPowered left a comment

Choose a reason for hiding this comment

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

This modification has integrated a regression

Names set with SetInfo are now not returned properly.

So we have a display name = B (in scoreboard, chat etc ... with SetInfo and when we do GetClientName we have a name A

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.

IGamePlayer::GetName with multibyte characters

3 participants