(svn r27756) -Codechange: Add StringTab enum

This commit is contained in:
frosch
2017-02-26 19:40:53 +00:00
parent f4da8ece0c
commit a56e2bccd0
10 changed files with 65 additions and 50 deletions

View File

@@ -502,11 +502,11 @@ static void Check_PLYR()
/* We do not load old custom names */
if (IsSavegameVersionBefore(84)) {
if (GetStringTab(cprops->name_1) == 15) {
if (GetStringTab(cprops->name_1) == TEXT_TAB_OLD_CUSTOM) {
cprops->name_1 = STR_GAME_SAVELOAD_NOT_AVAILABLE;
}
if (GetStringTab(cprops->president_name_1) == 15) {
if (GetStringTab(cprops->president_name_1) == TEXT_TAB_OLD_CUSTOM) {
cprops->president_name_1 = STR_GAME_SAVELOAD_NOT_AVAILABLE;
}
}

View File

@@ -61,7 +61,7 @@ char *_old_name_array = NULL;
char *CopyFromOldName(StringID id)
{
/* Is this name an (old) custom name? */
if (GetStringTab(id) != 15) return NULL;
if (GetStringTab(id) != TEXT_TAB_OLD_CUSTOM) return NULL;
if (IsSavegameVersionBefore(37)) {
/* Allow for expansion when converted to UTF-8. */

View File

@@ -286,7 +286,7 @@ static void Load_TOWN()
SlObject(&t->received[i], _town_received_desc);
}
if (t->townnamegrfid == 0 && !IsInsideMM(t->townnametype, SPECSTR_TOWNNAME_START, SPECSTR_TOWNNAME_LAST + 1) && GetStringTab(t->townnametype) != 15) {
if (t->townnamegrfid == 0 && !IsInsideMM(t->townnametype, SPECSTR_TOWNNAME_START, SPECSTR_TOWNNAME_LAST + 1) && GetStringTab(t->townnametype) != TEXT_TAB_OLD_CUSTOM) {
SlErrorCorrupt("Invalid town name generator");
}