(svn r16327) -Codechange: replace IsValidPoolItemID(index) by PoolItem::IsValidID(index)

This commit is contained in:
smatz
2009-05-17 01:00:56 +00:00
parent ed1e54bd84
commit 871107f529
78 changed files with 242 additions and 303 deletions

View File

@@ -1864,7 +1864,7 @@ void GenerateDefaultSaveName(char *buf, const char *last)
* available company. When there's no company available we'll use
* 'Spectator' as "company" name. */
CompanyID cid = _local_company;
if (!IsValidCompanyID(cid)) {
if (!Company::IsValidID(cid)) {
const Company *c;
FOR_ALL_COMPANIES(c) {
cid = c->index;
@@ -1884,7 +1884,7 @@ void GenerateDefaultSaveName(char *buf, const char *last)
SetDParam(2, _date);
/* Get the correct string (special string for when there's not company) */
GetString(buf, !IsValidCompanyID(cid) ? STR_GAME_SAVELOAD_SPECTATOR_SAVEGAME : STR_DEFAULT_SAVEGAME_NAME, last);
GetString(buf, !Company::IsValidID(cid) ? STR_GAME_SAVELOAD_SPECTATOR_SAVEGAME : STR_DEFAULT_SAVEGAME_NAME, last);
SanitizeFilename(buf);
}