]> git.localhorst.tv Git - blank.git/blobdiff - src/ai/ai.cpp
split chunk redering from world model
[blank.git] / src / ai / ai.cpp
index 5f5474b5f3320030e2f7e902badbb86c58328a79..fd03ebb4fec74e0cf3309f41e9ba44bee6546f1c 100644 (file)
@@ -33,10 +33,9 @@ void Chaser::Update(int dt) {
        glm::vec3 norm_diff(diff / dist);
 
        bool line_of_sight = true;
-       // FIXME: this only works if target is in the reference chunk (which is true for the player)
        Ray aim{Target().Position() - diff, norm_diff};
        WorldCollision coll;
-       if (world.Intersection(aim, glm::mat4(1.0f), coll)) {
+       if (world.Intersection(aim, glm::mat4(1.0f), Target().ChunkCoords(), coll)) {
                line_of_sight = coll.depth > dist;
        }