From 8242dbf0376e328a75e8ec538152480c05c01131 Mon Sep 17 00:00:00 2001 From: Steve Date: Mon, 29 Feb 2016 14:43:24 +0000 Subject: [PATCH] Use getFileLocation for loading files (install is broken on Linux). --- src/battle/capitalShips.c | 2 +- src/battle/fighters.c | 2 +- src/challenges/challenges.c | 2 +- src/challenges/challenges.h | 1 + src/galaxy/starSystems.c | 2 +- src/system/widgets.c | 2 +- 6 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/battle/capitalShips.c b/src/battle/capitalShips.c index 4e5cb21..deccb14 100644 --- a/src/battle/capitalShips.c +++ b/src/battle/capitalShips.c @@ -317,7 +317,7 @@ void loadCapitalShipDefs(void) memset(&defHead, 0, sizeof(Entity)); defTail = &defHead; - filenames = getFileList("data/capitalShips", &count); + filenames = getFileList(getFileLocation("data/capitalShips"), &count); for (i = 0 ; i < count ; i++) { diff --git a/src/battle/fighters.c b/src/battle/fighters.c index a1b6198..c05c544 100644 --- a/src/battle/fighters.c +++ b/src/battle/fighters.c @@ -622,7 +622,7 @@ static void loadFighterDefList(char *dir) char path[MAX_FILENAME_LENGTH]; int count, i; - filenames = getFileList(dir, &count); + filenames = getFileList(getFileLocation(dir), &count); for (i = 0 ; i < count ; i++) { diff --git a/src/challenges/challenges.c b/src/challenges/challenges.c index 93a2238..64ecece 100644 --- a/src/challenges/challenges.c +++ b/src/challenges/challenges.c @@ -54,7 +54,7 @@ void initChallenges(void) tail = &game.challengeMissionHead; - filenames = getFileList("data/challenges", &count); + filenames = getFileList(getFileLocation("data/challenges"), &count); for (i = 0 ; i < count ; i++) { diff --git a/src/challenges/challenges.h b/src/challenges/challenges.h index 5e46595..178cba7 100644 --- a/src/challenges/challenges.h +++ b/src/challenges/challenges.h @@ -26,6 +26,7 @@ extern void selectWidget(const char *name, const char *group); extern void retreatAllies(void); extern void retreatEnemies(void); extern char *getTranslatedString(char *string); +extern char *getFileLocation(char *filename); extern Battle battle; extern Entity *player; diff --git a/src/galaxy/starSystems.c b/src/galaxy/starSystems.c index 10a9903..3ae00ec 100644 --- a/src/galaxy/starSystems.c +++ b/src/galaxy/starSystems.c @@ -96,7 +96,7 @@ static void loadMissions(StarSystem *starSystem) sprintf(path, "data/missions/%s", name); - filenames = getFileList(path, &count); + filenames = getFileList(getFileLocation(path), &count); for (i = 0 ; i < count ; i++) { diff --git a/src/system/widgets.c b/src/system/widgets.c index 86798fa..cf86474 100644 --- a/src/system/widgets.c +++ b/src/system/widgets.c @@ -255,7 +255,7 @@ static void loadWidgets() char path[MAX_FILENAME_LENGTH]; int count, i; - filenames = getFileList("data/widgets", &count); + filenames = getFileList(getFileLocation("data/widgets"), &count); for (i = 0 ; i < count ; i++) {