diff options
author | Darkvater <darkvater@openttd.org> | 2006-03-16 00:22:36 +0000 |
---|---|---|
committer | Darkvater <darkvater@openttd.org> | 2006-03-16 00:22:36 +0000 |
commit | 537b7ed3c68d4f97343c4cc8bb036b713d9d1447 (patch) | |
tree | 32e61b5712855d0e9b5f96ab593ca7a3439c9815 | |
parent | d9ee10d3b835e713a117df6f8ffae20e3bf3b27e (diff) | |
download | openttd-537b7ed3c68d4f97343c4cc8bb036b713d9d1447.tar.xz |
(svn r3896) - [Patches] Fix: Honour any conditional settings when retrieving the setting entries.
-rw-r--r-- | settings.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/settings.c b/settings.c index 879c9ec7c..943824f9d 100644 --- a/settings.c +++ b/settings.c @@ -1384,6 +1384,7 @@ int32 CmdChangePatchSetting(int x, int y, uint32 flags, uint32 p1, uint32 p2) const SettingDesc *sd = GetSettingDescription(p1); if (sd == NULL) return CMD_ERROR; + if (!SlIsObjectCurrentlyValid(sd->save.version_from, sd->save.version_to)) return CMD_ERROR; if (flags & DC_EXEC) { Patches *patches_ptr = (_game_mode == GM_MENU) ? &_patches_newgame : &_patches; @@ -1428,6 +1429,7 @@ static const SettingDesc *GetPatchFromName(const char *name, uint *i) const SettingDesc *sd; for (*i = 0, sd = _patch_settings; sd->save.cmd != SL_END; sd++, (*i)++) { + if (!SlIsObjectCurrentlyValid(sd->save.version_from, sd->save.version_to)) continue; if (strcmp(sd->desc.name, name) == 0) return sd; } |