X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2FGameTick.cpp;h=ed22ee26b33e57f299ee51cd61f5c9fc450b8013;hb=d5f64d3689e1ce594e22ad0f6d372cee143872fd;hp=1f971e70f8f7869b67d0232493d7e1e6b9b74094;hpb=33270590a498f404a091ddf032850de2e7e3d037;p=lugaru.git diff --git a/Source/GameTick.cpp b/Source/GameTick.cpp index 1f971e7..ed22ee2 100644 --- a/Source/GameTick.cpp +++ b/Source/GameTick.cpp @@ -502,8 +502,9 @@ void Game::Loadlevel(int which) char buf[32]; snprintf(buf, 32, "map%d", which + 1); // challenges Loadlevel(buf); - } else + } else { Loadlevel("mapsave"); + } } void Game::Loadlevel(const std::string& name, bool tutorial) @@ -706,6 +707,10 @@ void Game::Loadlevel(const std::string& name, bool tutorial) funpackf(tfile, "Bi", &environment); + if (environment != oldenvironment) + Setenvironment(environment); + oldenvironment = environment; + Object::LoadObjectsFromFile(tfile, stealthloading); if (mapvers >= 7) { @@ -769,9 +774,6 @@ void Game::Loadlevel(const std::string& name, bool tutorial) funpackf(tfile, "Bf Bf Bf Bf", &mapcenter.x, &mapcenter.y, &mapcenter.z, &mapradius); SetUpLighting(); - if (environment != oldenvironment) - Setenvironment(environment); - oldenvironment = environment; if (!stealthloading) { Object::AddObjectsToTerrain(); @@ -924,9 +926,6 @@ void Game::Loadlevel(const std::string& name, bool tutorial) oldmusicvolume[2] = 0; oldmusicvolume[3] = 0; - if (!firstload) - firstload = 1; - leveltime = 0; wonleveltime = 0; visibleloading = false; @@ -4290,7 +4289,7 @@ void Game::TickOnceAfter() Person::players[i]->aitype == getweapontype || Person::players[i]->aitype == gethelptype || Person::players[i]->aitype == searchtype) && - !Person::players[i]->dead/*&&Person::players[i]->surprised<=0*/ && + !Person::players[i]->dead && (Person::players[i]->animTarget != sneakattackedanim && Person::players[i]->animTarget != knifesneakattackedanim && Person::players[i]->animTarget != swordsneakattackedanim)) { @@ -4553,8 +4552,9 @@ void Game::TickOnceAfter() loading = 2; loadtime = 0; targetlevel = 7; - if (!firstload) + if (!firstLoadDone) { LoadStuff(); + } whichchoice = 0; actuallevel = campaignlevels[actuallevel].nextlevel.front(); visibleloading = true;