diff options
author | frosch <frosch@openttd.org> | 2012-04-22 16:27:55 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2012-04-22 16:27:55 +0000 |
commit | 6f4d2160c25c75ed0d09657bfb0f85fdac65bfcd (patch) | |
tree | 0002c621456141b330133f45a959fe4c6b28ac7c /src/newgrf.cpp | |
parent | 73d926c8d4b7cb327cb1d3484dbecd8303268172 (diff) | |
download | openttd-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.cpp | 7 |
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; |