From 291db05ab93d63f5c7a6f0dcf3d144627c0c20c3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?C=C3=B4me=20Chilliet?= Date: Tue, 3 Jan 2017 01:48:18 +0100 Subject: [PATCH] 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. --- Source/GameTick.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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)) { -- 2.39.5