diff options
| author | Japa | 2010-04-15 06:01:49 +0000 |
|---|---|---|
| committer | Japa | 2010-04-15 06:01:49 +0000 |
| commit | 41a76c7d2933c720ac629c69cb4ac42e4d29a5c0 (patch) | |
| tree | 9cf69b47f149dbac73f9b28899ff2fb817933262 /BuildingConfiguration.cpp | |
| parent | 6080b32c19d36729b5293d71502b2aa101b8e215 (diff) | |
| download | stonesense-41a76c7d2933c720ac629c69cb4ac42e4d29a5c0.tar.gz stonesense-41a76c7d2933c720ac629c69cb4ac42e4d29a5c0.tar.bz2 stonesense-41a76c7d2933c720ac629c69cb4ac42e4d29a5c0.tar.xz | |
started working on getting custom buildings to work. not done yet, but backups are God.
Diffstat (limited to 'BuildingConfiguration.cpp')
| -rw-r--r-- | BuildingConfiguration.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/BuildingConfiguration.cpp b/BuildingConfiguration.cpp index 5181a69..629c316 100644 --- a/BuildingConfiguration.cpp +++ b/BuildingConfiguration.cpp @@ -74,3 +74,21 @@ int TranslateBuildingName( const char* currentName, vector<string>& buildingName WriteErr("Unable to match building '%s' to anything in-game\n", currentName);
return INVALID_INDEX;
}
+
+int TranslateCustomBuildingName( const char* currentName)
+{
+ if (currentName == NULL || currentName[0]==0)
+ return INVALID_INDEX;
+
+ uint32_t j;
+ uint32_t num = (uint32_t)contentLoader.custom_workshop_types.size();
+ for(j=0; j < num; j++){
+ if( strcmp( currentName, contentLoader.custom_workshop_types[j].c_str()) == 0){
+ //assign ID
+ return (j);
+ }
+ }
+
+ WriteErr("Unable to match building '%s' to anything in-game\n", currentName);
+ return INVALID_INDEX;
+}
|
