mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-12 18:40:29 +00:00
(svn r21041) -Change: [NewGRF] make object var 60 return the object id even when the relative tile is not part of the same object
This commit is contained in:
parent
a6cdb8a75c
commit
61e419e27f
@ -111,17 +111,14 @@ static void ObjectSetTriggers(const ResolverObject *object, int triggers)
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Make an analysis of a tile and check for its belonging to the same
|
* Make an analysis of a tile and get the object type.
|
||||||
* object, and/or the same grf file
|
|
||||||
* @param tile TileIndex of the tile to query
|
* @param tile TileIndex of the tile to query
|
||||||
* @param index Object to which to compare the tile to
|
|
||||||
* @param cur_grfid GRFID of the current callback chain
|
* @param cur_grfid GRFID of the current callback chain
|
||||||
* @return value encoded as per NFO specs
|
* @return value encoded as per NFO specs
|
||||||
*/
|
*/
|
||||||
static uint32 GetObjectIDAtOffset(TileIndex tile, ObjectID oid, uint32 cur_grfid)
|
static uint32 GetObjectIDAtOffset(TileIndex tile, uint32 cur_grfid)
|
||||||
{
|
{
|
||||||
if (!IsTileType(tile, MP_OBJECT) || GetObjectIndex(tile) != oid) {
|
if (!IsTileType(tile, MP_OBJECT)) {
|
||||||
/* No object and/or the tile does not have the same object as the one we match it with */
|
|
||||||
return 0xFFFF;
|
return 0xFFFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -295,7 +292,7 @@ static uint32 ObjectGetVariable(const ResolverObject *object, byte variable, byt
|
|||||||
case 0x46: return GetTownRadiusGroup(t, tile) << 16 | min(DistanceSquare(tile, t->xy), 0xFFFF);
|
case 0x46: return GetTownRadiusGroup(t, tile) << 16 | min(DistanceSquare(tile, t->xy), 0xFFFF);
|
||||||
|
|
||||||
/* Get object ID at offset param */
|
/* Get object ID at offset param */
|
||||||
case 0x60: return GetObjectIDAtOffset(GetNearbyTile(parameter, tile), o == NULL ? INVALID_OBJECT : o->index, object->grffile->grfid);
|
case 0x60: return GetObjectIDAtOffset(GetNearbyTile(parameter, tile), object->grffile->grfid);
|
||||||
|
|
||||||
/* Get random tile bits at offset param */
|
/* Get random tile bits at offset param */
|
||||||
case 0x61:
|
case 0x61:
|
||||||
|
Loading…
Reference in New Issue
Block a user