Fix a segfault caused by getFont().
authorMatt Mullins <mokomull@gmail.com>
Sat, 16 Jun 2012 04:52:50 +0000 (21:52 -0700)
committerMatt Mullins <mokomull@gmail.com>
Sat, 16 Jun 2012 05:07:39 +0000 (22:07 -0700)
The if(font has been found) statement was written the wrong-way-'round.

Game.cpp

index 4b7cec4..b81d9c2 100644 (file)
--- a/Game.cpp
+++ b/Game.cpp
@@ -241,7 +241,7 @@ Font* Game::getFont( int s = 24, FontType t = English){
        map<int, Font*> font = t == English ? mEnglishFonts : mJapaneseFonts;
        map<int, Font*>::iterator it = font.find(s);
        //if the font doesn't exist
-       if (it != font.end()) {
+       if (it == font.end()) {
                //create it
                Font* f = new Font(t, s);
                font[s] = f;