summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2014-02-07 22:55:33 +0000
committerfrosch <frosch@openttd.org>2014-02-07 22:55:33 +0000
commit50c6b2486b41e1849feb2c24a2c93342d0a170fe (patch)
tree81d0047f42d10613dcdd6b0ca3beacfedbbadca6
parent2e598be48f2580c9182709ebb776d23251e63544 (diff)
downloadopenttd-50c6b2486b41e1849feb2c24a2c93342d0a170fe.tar.xz
(svn r26316) -Feature [FS#5696]: Extend object variable 0x60 to also return the view.
-rw-r--r--src/newgrf_object.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/newgrf_object.cpp b/src/newgrf_object.cpp
index da12a51ee..3917b6510 100644
--- a/src/newgrf_object.cpp
+++ b/src/newgrf_object.cpp
@@ -158,7 +158,8 @@ static uint32 GetObjectIDAtOffset(TileIndex tile, uint32 cur_grfid)
return 0xFFFF;
}
- const ObjectSpec *spec = ObjectSpec::GetByTile(tile);
+ const Object *o = Object::GetByTile(tile);
+ const ObjectSpec *spec = ObjectSpec::Get(o->type);
/* Default objects have no associated NewGRF file */
if (spec->grf_prop.grffile == NULL) {
@@ -166,7 +167,7 @@ static uint32 GetObjectIDAtOffset(TileIndex tile, uint32 cur_grfid)
}
if (spec->grf_prop.grffile->grfid == cur_grfid) { // same object, same grf ?
- return spec->grf_prop.local_id;
+ return spec->grf_prop.local_id | o->view << 16;
}
return 0xFFFE; // Defined in another grf file