Implemented updateEntitySide().

This commit is contained in:
Steve 2016-05-20 09:51:53 +01:00
parent c17f1af851
commit c090942f81
2 changed files with 14 additions and 1 deletions

View File

@ -665,8 +665,20 @@ void killEntity(char *name)
}
}
void updateEntitySide(char *side, char *entity)
void updateEntitySide(char *sideStr, char *name)
{
Entity *e;
int side;
side = lookup(sideStr);
for (e = battle.entityHead.next ; e != NULL ; e = e->next)
{
if (strcmp(e->name, name) == 0)
{
e->side = side;
}
}
}
void destroyEntities(void)

View File

@ -36,6 +36,7 @@ extern void addToQuadtree(Entity *e, Quadtree *root);
extern void updateCapitalShipComponentProperties(Entity *parent, long flags);
extern Entity **getAllEntsWithin(int x, int y, int w, int h, Entity *ignore);
extern int isOnBattleScreen(int x, int y, int w, int h);
extern long lookup(char *name);
extern App app;
extern Battle battle;