Codechange: Allocate houses dynamically instead of from a fixed array.
This uses vectors for HouseSpecs and global/town building counts.
This commit is contained in:

committed by
Michael Lutz

parent
8746be8bf2
commit
3e83dcedfd
@@ -165,7 +165,11 @@ void HouseOverrideManager::SetEntitySpec(const HouseSpec *hs)
|
||||
return;
|
||||
}
|
||||
|
||||
*HouseSpec::Get(house_id) = *hs;
|
||||
auto &house_specs = HouseSpec::Specs();
|
||||
|
||||
/* Now that we know we can use the given id, copy the spec to its final destination. */
|
||||
if (house_id >= house_specs.size()) house_specs.resize(house_id + 1);
|
||||
house_specs[house_id] = *hs;
|
||||
|
||||
/* Now add the overrides. */
|
||||
for (int i = 0; i < this->max_offset; i++) {
|
||||
|
Reference in New Issue
Block a user