diff options
author | belugas <belugas@openttd.org> | 2007-10-04 00:59:52 +0000 |
---|---|---|
committer | belugas <belugas@openttd.org> | 2007-10-04 00:59:52 +0000 |
commit | aae3ca07c43858e39e4d6507aa47fd7f24db1b35 (patch) | |
tree | b40e46882b94545091f6a69ddbaf5927a00b8757 /src | |
parent | 7525f791c7c6048662c974a5c71a9f3243197965 (diff) | |
download | openttd-aae3ca07c43858e39e4d6507aa47fd7f24db1b35.tar.xz |
(svn r11198) -Fix: When industry override is not possible because it is already been overridden, mark the new candidate as not being an override
Diffstat (limited to 'src')
-rw-r--r-- | src/newgrf_commons.cpp | 3 | ||||
-rw-r--r-- | src/newgrf_commons.h | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/newgrf_commons.cpp b/src/newgrf_commons.cpp index 173997d99..68269c643 100644 --- a/src/newgrf_commons.cpp +++ b/src/newgrf_commons.cpp @@ -188,7 +188,7 @@ uint16 IndustryOverrideManager::AddEntityID(byte grf_local_id, uint32 grfid, byt * checking what is available * @param inds Industryspec that comes from the grf decoding process */ -void IndustryOverrideManager::SetEntitySpec(const IndustrySpec *inds) +void IndustryOverrideManager::SetEntitySpec(IndustrySpec *inds) { /* First step : We need to find if this industry is already specified in the savegame data */ IndustryType ind_id = this->GetID(inds->grf_prop.local_id, inds->grf_prop.grffile->grfid); @@ -206,6 +206,7 @@ void IndustryOverrideManager::SetEntitySpec(const IndustrySpec *inds) * Or it is a simple substitute. * In both case, we need to find a free available slot */ ind_id = this->AddEntityID(inds->grf_prop.local_id, inds->grf_prop.grffile->grfid, inds->grf_prop.subst_id); + inds->grf_prop.override = invalid_ID; // make sure it will not be detected as overriden } } diff --git a/src/newgrf_commons.h b/src/newgrf_commons.h index 51ebd93b8..a8e3eabf9 100644 --- a/src/newgrf_commons.h +++ b/src/newgrf_commons.h @@ -71,7 +71,7 @@ public: OverrideManagerBase(offset, maximum, invalid) {} virtual uint16 AddEntityID(byte grf_local_id, uint32 grfid, byte substitute_id); - void SetEntitySpec(const IndustrySpec *inds); + void SetEntitySpec(IndustrySpec *inds); }; |