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 user being able to enter formatting characters (fixes #2892) #2904

Merged
merged 2 commits into from
Feb 11, 2016

Conversation

Overv
Copy link
Contributor

@Overv Overv commented Feb 9, 2016

The original game silently removes these characters after entering them. It seems more appropriate for OpenRCT2 to simply not accept entering them.

@@ -712,6 +712,10 @@ void platform_process_messages()
if (e.text.text[0] == '`' && gConsoleOpen)
break;

// Entering formatting characters is not allowed
if (utf8_is_format_code((int)e.text.text[0]))
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not handling UTF-8 correctly, you need to use utf8_get_next.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should line 712 stay the way it is?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yea, UTF-8 is backwards compatible with ASCII, its only because some format codes are not ASCII that we need to do this.

IntelOrca added a commit that referenced this pull request Feb 11, 2016
Fix user being able to enter formatting characters (fixes #2892)
@IntelOrca IntelOrca merged commit ed44d94 into OpenRCT2:develop Feb 11, 2016
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