From eb894f970304e16f4b04088d652cd1c822c0ec61 Mon Sep 17 00:00:00 2001 From: Steve Date: Sun, 29 Nov 2015 13:23:27 +0000 Subject: [PATCH] Bug fix for activateEntities. Implemented EF_STATIC. --- src/battle/entities.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/battle/entities.c b/src/battle/entities.c index 3209998..e944623 100644 --- a/src/battle/entities.c +++ b/src/battle/entities.c @@ -98,6 +98,11 @@ void doEntities(void) restrictToGrid(e); + if (e->flags & EF_STATIC) + { + e->dx = e->dy = 0; + } + e->x += e->dx; e->y += e->dy; @@ -280,16 +285,24 @@ static void drawTargetRects(Entity *e) } } -void activateEntities(char *name) +void activateEntities(char *names) { Entity *e; + char *name; - for (e = battle.entityHead.next ; e != NULL ; e = e->next) + name = strtok(names, ";"); + + while (name) { - if (strcmp(e->name, name) == 0) + for (e = battle.entityHead.next ; e != NULL ; e = e->next) { - e->active = 1; + if (strcmp(e->name, name) == 0) + { + e->active = 1; + } } + + name = strtok(NULL, ";"); } }