]> git.jsancho.org Git - lugaru.git/commitdiff
Fix feedback on prev commits from MCMic
authorRémi Verschelde <rverschelde@gmail.com>
Sun, 29 Jan 2017 22:47:50 +0000 (23:47 +0100)
committerRémi Verschelde <rverschelde@gmail.com>
Sun, 29 Jan 2017 22:47:50 +0000 (23:47 +0100)
Source/GameDraw.cpp
Source/Objects/Person.cpp

index fd21a648541c880d246622cd72daced4fd0f5f1e..de4d97d37926a04e4ddd725f26a8684651f41c43 100644 (file)
@@ -664,7 +664,7 @@ int Game::DrawGLScene(StereoSide side)
                 }
             }
 
-            /* Drowing dialogs */
+            /* Drawing dialogs */
             if (Dialog::inDialog() && !mainmenu) {
                 glDisable(GL_DEPTH_TEST);
                 glDisable(GL_CULL_FACE);
index 27bd61d804dfaaddb93b5aaa2d43f225058c4cb2..55b62090c51b4016e23403852765e6ad9d129c2c 100644 (file)
@@ -8443,10 +8443,11 @@ void Person::doAI()
                 //chase player
                 XYZ rotatetarget = Person::players[0]->coords + Person::players[0]->velocity;
                 XYZ targetpoint = Person::players[0]->coords;
-                if (findLength(&velocity) != 0 &&
+                float vellength = findLength(&velocity);
+                if (vellength != 0 &&
                     distsq(&Person::players[0]->coords, &coords) < distsq(&rotatetarget, &coords)) {
                     targetpoint += Person::players[0]->velocity *
-                                   findDistance(&Person::players[0]->coords, &coords) / findLength(&velocity);
+                                   findDistance(&Person::players[0]->coords, &coords) / vellength;
                 }
                 targetyaw = roughDirectionTo(coords, targetpoint);
                 lookyaw = targetyaw;