]> git.localhorst.tv Git - blobs.git/blobdiff - src/creature/goal.cpp
remove ability to fly at will
[blobs.git] / src / creature / goal.cpp
index 55fa6c9ea7cc20b53565f96cffc9428b3748bd4a..abac4679dcbb93f822f7e54339e9c930071c5d5b 100644 (file)
@@ -260,7 +260,7 @@ std::string summarize(const Composition &comp, const app::Assets &assets) {
 IngestGoal::IngestGoal(Creature &c, Creature::Stat &stat)
 : Goal(c)
 , stat(stat)
-, accept()
+, accept(Assets().data.resources)
 , locate_subtask(nullptr)
 , ingesting(false)
 , resource(-1)
@@ -298,7 +298,7 @@ void IngestGoal::Tick(double dt) {
        }
        if (ingesting) {
                if (OnSuitableTile() && !GetSituation().Moving()) {
-                       GetCreature().Ingest(resource, yield * GetCreature().GetComposition().Compatibility(Assets().data.resources, resource) * dt);
+                       GetCreature().Ingest(resource, yield * GetCreature().GetComposition().Compatibility(resource) * dt);
                        stat.Add(-1.0 * yield * dt);
                        if (stat.Empty()) {
                                SetComplete();
@@ -340,7 +340,7 @@ void IngestGoal::Action() {
 }
 
 bool IngestGoal::OnSuitableTile() {
-       if (!GetSituation().OnSurface()) {
+       if (!GetSituation().OnGround()) {
                return false;
        }
        const world::TileType &t = GetSituation().GetTileType();
@@ -358,7 +358,7 @@ bool IngestGoal::OnSuitableTile() {
 
 LocateResourceGoal::LocateResourceGoal(Creature &c)
 : Goal(c)
-, accept()
+, accept(Assets().data.resources)
 , found(false)
 , target_pos(0.0)
 , searching(false)