[Client Crash] - % Symbol Crashes Game.


The Letter W

Recommended Posts

Bug Submission:

Category: Client Crash

Issue Title: % Symbol Crashes Game.

Issue Description: Not only does it crash the game, it gives a very weird result!

tumblr_ndqk3ftFj41r4q7yco1_1280.jpg

The second time I typed it, the game crashed. I have no idea what could have caused this. (.exe has stopped working variant)

Steps to Reproduce: Enter game (I was hosting)

Type percent symbol in chat and send.

Do it again.

Link to comment
Share on other sites

Things like "%s" and "%f" are used in "formatted strings" -- basically you can have a string that's like "Hi, my name is %s, would you like to go to %s?" (let's say it's in the variable str), then you can pass it to a formatter with arguments to put in place of each %s, like this:

 

formatstring(str, "Rezecib", "the movies")

 

resulting in "Hi, my name is Rezecib, would you like to go to the movies?"

 

What's happening right now is that there's a formatting call happening somewhere between the chat input box and where it gets displayed. You can see different results if you type different % keywords, like %d for digit, %f for float, %s for string.

 

As for why it crashed after the second percent... that's mysterious.

 

But anyway, for the devs, I fiddled with this for a bit today and you can fix this by changing line 79 of chatinputscreen.lua to the following:

	local chat_string = self.chat_edit:GetString():gsub("%%", "%%%%")

Meanwhile for players, if you want to type a %, just type two in its place.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.