]> git.jsancho.org Git - lugaru.git/commitdiff
Fixed bushes appearing above ground on first level loaded
authorCôme Chilliet <come@chilliet.eu>
Tue, 3 Jan 2017 00:48:18 +0000 (01:48 +0100)
committerCôme Chilliet <come@chilliet.eu>
Tue, 3 Jan 2017 00:48:18 +0000 (01:48 +0100)
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

index 2a4f4bd8a644cbc0fcd174390a4ee1aad7c3ab1c..ed22ee26b33e57f299ee51cd61f5c9fc450b8013 100644 (file)
@@ -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)) {