From: RĂ©mi Verschelde Date: Sun, 29 Jan 2017 22:47:50 +0000 (+0100) Subject: Fix feedback on prev commits from MCMic X-Git-Url: https://git.jsancho.org/?a=commitdiff_plain;h=762fb78d53f8be2003944fbdcc84f87e7851f453;p=lugaru.git Fix feedback on prev commits from MCMic --- diff --git a/Source/GameDraw.cpp b/Source/GameDraw.cpp index fd21a64..de4d97d 100644 --- a/Source/GameDraw.cpp +++ b/Source/GameDraw.cpp @@ -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); diff --git a/Source/Objects/Person.cpp b/Source/Objects/Person.cpp index 27bd61d..55b6209 100644 --- a/Source/Objects/Person.cpp +++ b/Source/Objects/Person.cpp @@ -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;