Merge pull request #6 from posva/master

Fixed a crash
master
Eduardo San Martin Morote 2012-12-27 10:26:35 -08:00
commit 02bf41b146
1 changed files with 5 additions and 3 deletions

View File

@ -53,15 +53,17 @@ RichText & RichText::operator << (const sf::String &string)
if(string.find('\n') != std::string::npos)
std::cerr << "sfe::RichtText: Oops, character \n found."
"You will get visual errors." << std::endl;
//String cannot be void
//assert(string != "");
// Add string
myTexts.push_back(sf::Text());
myTexts.push_back(sf::Text(string));
// Setup string
sf::Text &text = myTexts.back();
text.setColor(myCurrentColor);
text.setStyle(myCurrentStyle);
text.setString(string);
// Return
return *this;