diff --git a/src/galaxy/mission.c b/src/galaxy/mission.c index d284feb..6ebb636 100644 --- a/src/galaxy/mission.c +++ b/src/galaxy/mission.c @@ -201,7 +201,7 @@ void loadMission(char *filename) static char *getAutoBackground(char *filename) { - int hash; + unsigned long hash; if (!game.currentMission->challengeData.isChallenge) { @@ -217,7 +217,7 @@ static char *getAutoBackground(char *filename) static char *getAutoPlanet(char *filename) { - int hash; + unsigned long hash; if (!game.currentMission->challengeData.isChallenge) { @@ -233,7 +233,7 @@ static char *getAutoPlanet(char *filename) static char *getAutoMusic(char *filename) { - int hash; + unsigned long hash; if (!game.currentMission->challengeData.isChallenge) { @@ -241,7 +241,7 @@ static char *getAutoMusic(char *filename) } else { - hash = hashcode(filename); + hash = hashcode(game.currentMission->description); } return getMusicFilename(hash); diff --git a/src/galaxy/mission.h b/src/galaxy/mission.h index c616bdd..2329592 100644 --- a/src/galaxy/mission.h +++ b/src/galaxy/mission.h @@ -44,9 +44,9 @@ extern void initMissionInfo(void); extern char *getTranslatedString(char *string); extern void updateStarSystemMissions(void); extern void updateChallengeMissions(void); -extern char *getBackgroundTextureName(int n); -extern char *getPlanetTextureName(int n); -extern char *getMusicFilename(int n); +extern char *getBackgroundTextureName(unsigned long n); +extern char *getPlanetTextureName(unsigned long n); +extern char *getMusicFilename(unsigned long n); extern int getJSONValue(cJSON *node, char *name, int defValue); extern char *getJSONValueStr(cJSON *node, char *name, char *defValue); extern void addAllToQuadtree(void); diff --git a/src/system/resources.c b/src/system/resources.c index ba88d56..34f6b63 100644 --- a/src/system/resources.c +++ b/src/system/resources.c @@ -81,17 +81,17 @@ void initResources(void) free(filenames); } -char *getBackgroundTextureName(int i) +char *getBackgroundTextureName(unsigned long i) { return backgrounds[i % numBackgrounds]; } -char *getPlanetTextureName(int i) +char *getPlanetTextureName(unsigned long i) { return planets[i % numPlanets]; } -char *getMusicFilename(int i) +char *getMusicFilename(unsigned long i) { return musicFiles[i % numMusicFiles]; }