Changeset - r15978:b447a282d232
[Not reviewed]
master
0 1 0
rubidium - 14 years ago 2010-08-28 22:26:25
rubidium@openttd.org
(svn r20676) -Codechange: it's not needed to supply two almost identical vars
1 file changed with 1 insertions and 5 deletions:
0 comments (0 inline, 0 general)
src/newgrf_object.cpp
Show inline comments
 
@@ -233,13 +233,12 @@ static uint32 ObjectGetVariable(const Re
 
			/* Allow these when there's no object. */
 
			case 0x41:
 
			case 0x60:
 
			case 0x61:
 
			case 0x62:
 
			case 0x64:
 
			case 0x65:
 
				break;
 

	
 
			/* Allow these, but find the closest town. */
 
			case 0x45:
 
			case 0x46:
 
				t = ClosestTownFromTile(tile, UINT_MAX);
 
@@ -307,17 +306,14 @@ static uint32 ObjectGetVariable(const Re
 

	
 
		/* Animation counter of nearby tile */
 
		case 0x63:
 
			tile = GetNearbyTile(parameter, tile);
 
			return (IsTileType(tile, MP_OBJECT) && Object::GetByTile(tile) == o) ? GetObjectAnimationCounter(tile) : 0;
 

	
 
		/* Distance of nearest object of given type */
 
		case 0x64: return GetClosestObject(tile, GetObjectType(tile), o);
 

	
 
		/* Count of object, distance of closest instance */
 
		case 0x65: return GetCountAndDistanceOfClosestInstance(parameter, object->grffile->grfid, tile, o);
 
		case 0x64: return GetCountAndDistanceOfClosestInstance(parameter, object->grffile->grfid, tile, o);
 
	}
 

	
 
	DEBUG(grf, 1, "Unhandled object property 0x%X", variable);
 

	
 
	*available = false;
 
	return UINT_MAX;
0 comments (0 inline, 0 general)