Files @ r3378:1378dd83a597
Branch filter:

Location: cpp/openttd-patchpack/source/town_map.h

celestar
(svn r4180) -Fix: Fixed an assert in the elrail drawing code due to passing of a wrong variable. I wish the compiler would warn about different enum types used...
/* $Id$ */

#include "town.h"

static inline int GetHouseType(TileIndex t)
{
	assert(IsTileType(t, MP_HOUSE));
	return _m[t].m4;
}

static inline uint GetTownIndex(TileIndex t)
{
	assert(IsTileType(t, MP_HOUSE) || IsTileType(t, MP_STREET)); // XXX incomplete
	return _m[t].m2;
}

static inline Town* GetTownByTile(TileIndex t)
{
	return GetTown(GetTownIndex(t));
}