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

Fix silent fail on player name change #388

Closed
wants to merge 1 commit into from
Closed

Fix silent fail on player name change #388

wants to merge 1 commit into from

Conversation

KirillBorunov
Copy link
Contributor

This fixes #387
Error description taken from here: https://open.mp/docs/scripting/functions/SetPlayerName

{
if(PlayerInternal.Instance.SetPlayerName(Id, value) == -1)
{
throw new Exception("The name is already in use, too long or has invalid characters.");
Copy link
Owner

Choose a reason for hiding this comment

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

Could you change it to InvalidOperationException?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK. But wait, I'm adding similar return codes handling on the other setters, seems that all lacks these checks.

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.

Setting invalid or occupied player name is failing silently
2 participants