From 89eb8d4a34582ef95f22d6a976172373481b56cc Mon Sep 17 00:00:00 2001 From: Steve Date: Sun, 15 May 2016 14:02:35 +0100 Subject: [PATCH] Allow script to change the side of an entity (for use during optional missions). --- src/battle/entities.c | 4 ++++ src/battle/script.c | 5 +++++ src/battle/script.h | 1 + 3 files changed, 10 insertions(+) diff --git a/src/battle/entities.c b/src/battle/entities.c index 2c45a53..acd1881 100644 --- a/src/battle/entities.c +++ b/src/battle/entities.c @@ -655,6 +655,10 @@ void killEntity(char *name) } } +void updateEntitySide(char *side, char *entity) +{ +} + void destroyEntities(void) { Entity *e; diff --git a/src/battle/script.c b/src/battle/script.c index c89d5bd..b0722f3 100644 --- a/src/battle/script.c +++ b/src/battle/script.c @@ -288,6 +288,11 @@ static void executeNextLine(ScriptRunner *runner) sscanf(line, "%*s %[^\n]", strParam[0]); killEntity(strParam[0]); } + else if (strcmp(command, "UPDATE_ENTITY_SIDE") == 0) + { + sscanf(line, "%*s %s %[^\n]", strParam[0], strParam[1]); + updateEntitySide(strParam[0], strParam[1]); + } else { printf("ERROR: Unrecognised script command '%s'\n", command); diff --git a/src/battle/script.h b/src/battle/script.h index cc7e1ff..abf262c 100644 --- a/src/battle/script.h +++ b/src/battle/script.h @@ -40,6 +40,7 @@ extern void activateSpawner(char *name, int active); extern void completeAllObjectives(void); extern void createChristabelLocation(void); extern void killEntity(char *name); +extern void updateEntitySide(char *side, char *entity); extern Battle battle; extern Colors colors;