From: Côme Chilliet Date: Tue, 3 Jan 2017 00:48:18 +0000 (+0100) Subject: Fixed bushes appearing above ground on first level loaded X-Git-Url: https://git.jsancho.org/?p=lugaru.git;a=commitdiff_plain;h=291db05ab93d63f5c7a6f0dcf3d144627c0c20c3 Fixed bushes appearing above ground on first level loaded This was because Setenvironment was done after objects loading, and this is were terrain heightmap is built. This might be related to the appearing inside a rock bug, not sure. --- diff --git a/Source/GameTick.cpp b/Source/GameTick.cpp index 2a4f4bd..ed22ee2 100644 --- a/Source/GameTick.cpp +++ b/Source/GameTick.cpp @@ -707,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) { @@ -770,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(); @@ -4288,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)) {