summaryrefslogtreecommitdiff
path: root/CreatureConfiguration.cpp
diff options
context:
space:
mode:
authorJonas Ask2010-04-26 21:57:01 +0000
committerJonas Ask2010-04-26 21:57:01 +0000
commit34ae0fe3ea676a5a63fe0ef2cb484a8bfc51f1b9 (patch)
tree0f0f4f5bba87e98bb7cc804465c2eb26617f84a1 /CreatureConfiguration.cpp
parent556d4b5c6882f2a695b4936c71261ed27306380b (diff)
downloadstonesense-34ae0fe3ea676a5a63fe0ef2cb484a8bfc51f1b9.tar.gz
stonesense-34ae0fe3ea676a5a63fe0ef2cb484a8bfc51f1b9.tar.bz2
stonesense-34ae0fe3ea676a5a63fe0ef2cb484a8bfc51f1b9.tar.xz
Fixed slight bug in profession matching algorithm.
Added new Troll image. Enabled Intro Screen for release.
Diffstat (limited to 'CreatureConfiguration.cpp')
-rw-r--r--CreatureConfiguration.cpp31
1 files changed, 14 insertions, 17 deletions
diff --git a/CreatureConfiguration.cpp b/CreatureConfiguration.cpp
index 738d357..0ee25e9 100644
--- a/CreatureConfiguration.cpp
+++ b/CreatureConfiguration.cpp
@@ -51,27 +51,24 @@ void DumpProfessionsToDisk(){
int translateProfession(const char* currentProf)
{
+ uint32_t j, dfNumJobs;
+ string proffStr;
+
if (currentProf == NULL || currentProf[0]==0)
return INVALID_INDEX;
- uint32_t j;
- string proffStr;
- try
- {
- for(j=0; true; j++)
- {
- proffStr = contentLoader.professionStrings[j];
- if( proffStr.compare( currentProf ) == 0)
- {
- //assign ID
- return j;
- }
+
+ dfNumJobs = sizeof(contentLoader.professionStrings) / sizeof(contentLoader.professionStrings[0]);
+ for(j=0; j < dfNumJobs; j++)
+ {
+ proffStr = contentLoader.professionStrings[j];
+ if( proffStr.compare( currentProf ) == 0)
+ {
+ //assign ID
+ return j;
}
}
- catch (Error::MissingMemoryDefinition)
- {
- WriteErr("Unable to match profession '%s' to anything in-game\n", currentProf);
- return INT_MAX; //if it is left at INVALID_INDEX, the condition is ignored entierly.
- }
+ WriteErr("Unable to match profession '%s' to anything in-game\n", currentProf);
+ return INT_MAX; //if it is left at INVALID_INDEX, the condition is ignored entierly.
}
void pushCreatureConfig( vector<vector<CreatureConfiguration>*>& knownCreatures, unsigned int gameID, CreatureConfiguration& cre)