From 22ab49928288775acfd1224eeb8b8014158efd92 Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Sat, 16 Aug 2014 04:31:10 +0200 Subject: [PATCH] Server/AI: Fix bug in standing-on-consumable test. --- src/server/ai.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/server/ai.c b/src/server/ai.c index b8850a8..d536f14 100644 --- a/src/server/ai.c +++ b/src/server/ai.c @@ -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) -- 2.30.2