summaryrefslogtreecommitdiff
path: root/src/newgrf.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2012-04-22 16:27:55 +0000
committerfrosch <frosch@openttd.org>2012-04-22 16:27:55 +0000
commit6f4d2160c25c75ed0d09657bfb0f85fdac65bfcd (patch)
tree0002c621456141b330133f45a959fe4c6b28ac7c /src/newgrf.cpp
parent73d926c8d4b7cb327cb1d3484dbecd8303268172 (diff)
downloadopenttd-6f4d2160c25c75ed0d09657bfb0f85fdac65bfcd.tar.xz
(svn r24162) -Codechange: Remove NewGRFClass::GetName() and SetName() in favour of using Get() and direct member access (which is needed anyway for GRF string resolving).
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 1f796b258..4f825d591 100644
--- a/src/newgrf.cpp
+++ b/src/newgrf.cpp
@@ -3809,8 +3809,9 @@ static ChangeInfoResult ObjectChangeInfo(uint id, int numinfo, int prop, ByteRea
case 0x09: { // Class name
StringID class_name = buf->ReadWord();
- ObjectClass::SetName(spec->cls_id, class_name);
- _string_to_grf_mapping[&ObjectClass::classes[spec->cls_id].name] = _cur.grffile->grfid;
+ ObjectClass *objclass = ObjectClass::Get(spec->cls_id);
+ objclass->name = class_name;
+ _string_to_grf_mapping[&objclass->name] = _cur.grffile->grfid;
break;
}
@@ -5351,7 +5352,7 @@ static void FeatureNewName(ByteReader *buf)
grfmsg(1, "FeatureNewName: Attempt to name undefined station 0x%X, ignoring", GB(id, 0, 8));
} else {
StationClassID cls_id = _cur.grffile->stations[GB(id, 0, 8)]->cls_id;
- StationClass::SetName(cls_id, AddGRFString(_cur.grffile->grfid, id, lang, new_scheme, false, name, STR_UNDEFINED));
+ StationClass::Get(cls_id)->name = AddGRFString(_cur.grffile->grfid, id, lang, new_scheme, false, name, STR_UNDEFINED);
}
break;