summaryrefslogtreecommitdiff
path: root/src/newgrf.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2011-11-01 00:23:41 +0000
committerfrosch <frosch@openttd.org>2011-11-01 00:23:41 +0000
commitacc3c75951c4db0873db794b657697774f0ff9e9 (patch)
tree2b7e5f953286b09c3c07688c9e8c49ee953c5adb /src/newgrf.cpp
parent72cd855978bf45fd444eae72551a12e13a35b0c8 (diff)
downloadopenttd-acc3c75951c4db0873db794b657697774f0ff9e9.tar.xz
(svn r23075) -Codechange: Add GetGRF() and GetGRFID() methods to Engine and Vehicle to simplify code.
Diffstat (limited to 'src/newgrf.cpp')
-rw-r--r--src/newgrf.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/newgrf.cpp b/src/newgrf.cpp
index af5e25021..a7982be35 100644
--- a/src/newgrf.cpp
+++ b/src/newgrf.cpp
@@ -7956,7 +7956,7 @@ static void CalculateRefitMasks()
if (_gted[engine].refitmask_valid) {
if (ei->refit_mask != 0) {
const GRFFile *file = _gted[engine].refitmask_grf;
- if (file == NULL) file = e->grf_prop.grffile;
+ if (file == NULL) file = e->GetGRF();
if (file != NULL && file->cargo_max != 0) {
/* Apply cargo translation table to the refit mask */
uint num_cargo = min(32, file->cargo_max);
@@ -8029,7 +8029,7 @@ static void FinaliseEngineArray()
Engine *e;
FOR_ALL_ENGINES(e) {
- if (e->grf_prop.grffile == NULL) {
+ if (e->GetGRF() == NULL) {
const EngineIDMapping &eid = _engine_mngr[e->index];
if (eid.grfid != INVALID_GRFID || eid.internal_id != eid.substitute_id) {
e->info.string_id = STR_NEWGRF_INVALID_ENGINE;
@@ -8039,7 +8039,7 @@ static void FinaliseEngineArray()
/* When the train does not set property 27 (misc flags), but it
* is overridden by a NewGRF graphically we want to disable the
* flipping possibility. */
- if (e->type == VEH_TRAIN && !_gted[e->index].prop27_set && e->grf_prop.grffile != NULL && is_custom_sprite(e->u.rail.image_index)) {
+ if (e->type == VEH_TRAIN && !_gted[e->index].prop27_set && e->GetGRF() != NULL && is_custom_sprite(e->u.rail.image_index)) {
ClrBit(e->info.misc_flags, EF_RAIL_FLIPS);
}