diff options
| author | Jonas Ask | 2010-04-26 21:57:01 +0000 |
|---|---|---|
| committer | Jonas Ask | 2010-04-26 21:57:01 +0000 |
| commit | 34ae0fe3ea676a5a63fe0ef2cb484a8bfc51f1b9 (patch) | |
| tree | 0f0f4f5bba87e98bb7cc804465c2eb26617f84a1 /CreatureConfiguration.cpp | |
| parent | 556d4b5c6882f2a695b4936c71261ed27306380b (diff) | |
| download | stonesense-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.cpp | 31 |
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)
|
