Ported 2007-10-01T11:26:25Z!koraq@xs4all.nl.

This commit is contained in:
Mark de Wever 2007-10-01 12:13:24 +00:00
parent 3cc81bbe07
commit c5bc4e2a91
3 changed files with 11 additions and 1 deletions

View file

@ -36,6 +36,7 @@ Version 1.3.8+svn:
* Triple Blitz to Alirok Marsh
* minimum number of turns reduced to 1
* new option to allow female leaders by default instead of male leaders
* fixed a crash if the client recieves invalid utf-8
* units:
* balancing changes:
* created undead variations for the 'bat' and 'gryphon' race

View file

@ -42,6 +42,7 @@ Version 1.3.8+svn:
* Meteor Lake to Fallenstar Lake
* Triple Blitz to Alirok Marsh
* Minimum number of turns reduced to 1.
* Fixed a crash if the client recieves invalid utf-8.
* Unit changes and balancing
* Created undead variations for the 'bat' and 'gryphon' race.

View file

@ -1140,7 +1140,15 @@ void game_display::add_chat_message(const std::string& speaker, int side, const
msg = message;
action = false;
}
msg = font::word_wrap_text(msg,font::SIZE_SMALL,map_outside_area().w*3/4);
try {
// We've had a joker who send an invalid utf-8 message to crash clients
// so now catch the exception and ignore the message.
msg = font::word_wrap_text(msg,font::SIZE_SMALL,map_outside_area().w*3/4);
} catch (utils::invalid_utf8_exception&) {
LOG_STREAM(err, engine) << "Invalid utf-8 found, chat message is ignored.\n";
return;
}
int ypos = chat_message_x;
for(std::vector<chat_message>::const_iterator m = chat_messages_.begin(); m != chat_messages_.end(); ++m) {