home · contact · privacy
Server/AI: Fix bug in standing-on-consumable test.
authorChristian Heller <c.heller@plomlompom.de>
Sat, 16 Aug 2014 02:31:10 +0000 (04:31 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Sat, 16 Aug 2014 02:31:10 +0000 (04:31 +0200)
src/server/ai.c

index b8850a8155c6772b6d7e0ae279430e88b432fe31..d536f14e2f629c5f131d9a3b1dc6e2142152206e 100644 (file)
@@ -224,7 +224,8 @@ static uint8_t standing_on_consumable(struct Thing * t_standing)
     struct Thing * t = world.things;
     for (; t != NULL; t = t->next)
     {
-        if (t->pos.y == t_standing->pos.y && t->pos.x && t_standing->pos.x)
+        if (   t_standing != t
+            && t->pos.y == t_standing->pos.y && t->pos.x == t_standing->pos.x)
         {
             struct ThingType * tt = get_thing_type(t->type);
             if (tt->consumable)