summaryrefslogtreecommitdiff
path: root/src/newgrf.cpp
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2009-06-26 14:02:27 +0000
committersmatz <smatz@openttd.org>2009-06-26 14:02:27 +0000
commitb668c24d463ca8059fd9be59efddb39298de9646 (patch)
tree5fbd935d6d1dc65d5ebc160333b25c09e2e5b6c7 /src/newgrf.cpp
parentaf78d6a9bbc4142958f07b8774ef28d0b7c22f49 (diff)
downloadopenttd-b668c24d463ca8059fd9be59efddb39298de9646.tar.xz
(svn r16666) -Codechange: replace GetHouseSpecs() by HouseSpec::Get(), hide _house_specs[]
Diffstat (limited to 'src/newgrf.cpp')
-rw-r--r--src/newgrf.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/newgrf.cpp b/src/newgrf.cpp
index be9e335b8..9c28118c6 100644
--- a/src/newgrf.cpp
+++ b/src/newgrf.cpp
@@ -41,6 +41,7 @@
#include "map_func.h"
#include <map>
#include "core/alloc_type.hpp"
+#include "core/mem_func.hpp"
#include "table/strings.h"
#include "table/build_industry.h"
@@ -1473,7 +1474,7 @@ static ChangeInfoResult TownHouseChangeInfo(uint hid, int numinfo, int prop, byt
if (subs_id == 0xFF) {
/* Instead of defining a new house, a substitute house id
* of 0xFF disables the old house with the current id. */
- _house_specs[hid + i].enabled = false;
+ HouseSpec::Get(hid + i)->enabled = false;
continue;
} else if (subs_id >= NEW_HOUSE_OFFSET) {
/* The substitute id must be one of the original houses. */
@@ -1486,7 +1487,7 @@ static ChangeInfoResult TownHouseChangeInfo(uint hid, int numinfo, int prop, byt
housespec = *house;
- memcpy(housespec, &_house_specs[subs_id], sizeof(_house_specs[subs_id]));
+ MemCpyT(housespec, HouseSpec::Get(subs_id));
housespec->enabled = true;
housespec->local_id = hid + i;
@@ -5826,7 +5827,7 @@ static void FinaliseHouseArray()
if (min_year != 0) {
for (int i = 0; i < HOUSE_MAX; i++) {
- HouseSpec *hs = GetHouseSpecs(i);
+ HouseSpec *hs = HouseSpec::Get(i);
if (hs->enabled && hs->min_year == min_year) hs->min_year = 0;
}