X-Git-Url: http://git.localhorst.tv/?p=blobs.git;a=blobdiff_plain;f=src%2Fcreature%2Fgoal.cpp;h=3f61e2e8b80214571a75753f5581611ffa970d2c;hp=bcb1682be1bca9514d81a2cbb3fdf3f985fa84f1;hb=215c77b9d61ed635176edb86e54c6e87a1315dcf;hpb=9bc766beab23c8c5f507ca3c7abce24049e6229e diff --git a/src/creature/goal.cpp b/src/creature/goal.cpp index bcb1682..3f61e2e 100644 --- a/src/creature/goal.cpp +++ b/src/creature/goal.cpp @@ -384,6 +384,8 @@ void LocateResourceGoal::LocateResource() { } } else { // well, what now? + found = false; + searching = false; } } @@ -451,8 +453,8 @@ void LocateResourceGoal::SearchVicinity() { target_pos = GetSituation().Position(); target_pos[(srf + 0) % 3] += Assets().random.SNorm(); target_pos[(srf + 1) % 3] += Assets().random.SNorm(); - // bias towards current direction - target_pos += glm::normalize(GetSituation().Velocity()) * 0.5; + // bias towards current heading + target_pos += GetSituation().Heading() * 0.5; target_pos = clamp(target_pos, -planet.Radius(), planet.Radius()); GetSteering().GoTo(target_pos); }