From 6409e4ec11bc07369f49a931080e2d44fac2eaf7 Mon Sep 17 00:00:00 2001 From: Steve Date: Thu, 29 Oct 2015 11:35:59 +0000 Subject: [PATCH] Always shift entities, even if inactive. --- data/missions/alba/02 - patrol #2.json | 28 ++++++++++++++++++++++++-- src/battle/entities.c | 13 ++++++------ src/battle/waypoints.c | 2 +- 3 files changed, 34 insertions(+), 9 deletions(-) diff --git a/data/missions/alba/02 - patrol #2.json b/data/missions/alba/02 - patrol #2.json index 7afe13d..acb1cee 100644 --- a/data/missions/alba/02 - patrol #2.json +++ b/data/missions/alba/02 - patrol #2.json @@ -7,10 +7,33 @@ "requires" : "PREVIOUS", "objectives" : [ { - "description" : "Check all Wayponts", + "description" : "Check all Waypoints", "targetName" : "Waypoint", "targetValue" : 5, "targetType" : "TT_WAYPOINT" + }, + { + "description" : "Destroy Pandoran fighters", + "targetName" : "Pandoran", + "targetValue" : 3, + "targetType" : "TT_DESTROY", + "active" : 0 + } + ], + "triggers" : [ + { + "type" : "TRIGGER_WAYPOINT", + "targetName" : "Waypoint #5", + "targetValue" : "1", + "action" : "TA_ACTIVE_ENTITY", + "actionValue" : "Pandoran" + }, + { + "type" : "TRIGGER_WAYPOINT", + "targetName" : "Waypoint #5", + "targetValue" : "1", + "action" : "TA_ACTIVE_OBJECTIVE", + "actionValue" : "1" } ], "player" : { @@ -36,7 +59,8 @@ "side" : "SIDE_PANDORAN", "x" : 640, "y" : 1000, - "scatter" : 64 + "scatter" : 64, + "active" : 0 } ], "entityGroups" : [ diff --git a/src/battle/entities.c b/src/battle/entities.c index 88025bb..043de44 100644 --- a/src/battle/entities.c +++ b/src/battle/entities.c @@ -46,6 +46,13 @@ void doEntities(void) for (e = battle.entityHead.next ; e != NULL ; e = e->next) { + /* must always be shifted, even if not active */ + if (e != player) + { + e->x -= battle.ssx; + e->y -= battle.ssy; + } + if (e->active) { self = e; @@ -59,12 +66,6 @@ void doEntities(void) e->x += e->dx; e->y += e->dy; - if (e != player) - { - e->x -= battle.ssx; - e->y -= battle.ssy; - } - if (e->action != NULL) { if (--e->thinkTime <= 0) diff --git a/src/battle/waypoints.c b/src/battle/waypoints.c index 9f3e825..9d517ef 100644 --- a/src/battle/waypoints.c +++ b/src/battle/waypoints.c @@ -56,7 +56,7 @@ static void think(void) self->angle -= 360; } - if (player != NULL && getDistance(player->x, player->y, self->x, self->y) <= 32 && teamMatesClose()) + if (player != NULL && getDistance(player->x, player->y, self->x, self->y) <= 64 && teamMatesClose()) { self->health = 0;