]> git.jsancho.org Git - lugaru.git/blobdiff - Source/GameTick.cpp
I had added the wrong maps, not it works better
[lugaru.git] / Source / GameTick.cpp
index df85211eacfffc298c29c599170ed9201a5a6ff0..36452aa4f5e09f5c6de70fdc6ef92e8ee51199d1 100644 (file)
@@ -1408,13 +1408,14 @@ void Game::Loadlevel(int which){
            Loadlevel("tutorial");
        }else if(which >= 0 && which <= 15){
            char buf[32];
-           snprintf(buf, 32, "map%d", which + 1);
+           snprintf(buf, 32, "map%d", which + 1); // challenges
            Loadlevel(buf);
        }else
            Loadlevel("mapsave");
 }
 
 void Game::Loadlevel(const char *name){
+       cout << "loading level " << name << "…" << endl;
        int templength;
        float lamefloat;
        static const char *pfx = ":Data:Maps:";
@@ -5740,6 +5741,14 @@ void Game::MenuTick(){
                                                        accountactive->setCurrentCampaign(*c);
                                                }
                                                LoadCampaign();
+                                               if(Mainmenuitems[7])
+                                                       glDeleteTextures(1,&Mainmenuitems[7]);
+                                               ifstream test(ConvertFileName((":Data:Textures:"+accountactive->getCurrentCampaign()+":World.png").c_str()));
+                                               if(test.good()) {
+                                                       LoadTexture((":Data:Textures:"+accountactive->getCurrentCampaign()+":World.png").c_str(),&Mainmenuitems[7],0,0);
+                                               } else {
+                                                       LoadTexture(":Data:Textures:World.png",&Mainmenuitems[7],0,0);
+                                               }
                                                break;
                                }
                                break;