mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-04 06:00:15 +00:00
34 lines
524 B
C
34 lines
524 B
C
/* $Id$ */
|
|
|
|
#include "industry.h"
|
|
#include "macros.h"
|
|
#include "tile.h"
|
|
|
|
|
|
static inline uint GetIndustryIndex(TileIndex t)
|
|
{
|
|
return _m[t].m2;
|
|
}
|
|
|
|
static inline Industry* GetIndustryByTile(TileIndex t)
|
|
{
|
|
return GetIndustry(GetIndustryIndex(t));
|
|
}
|
|
|
|
|
|
static inline bool IsIndustryCompleted(TileIndex tile)
|
|
{
|
|
return HASBIT(_m[tile].m1, 7);
|
|
}
|
|
|
|
|
|
static inline void MakeIndustry(TileIndex t, uint index, uint gfx)
|
|
{
|
|
SetTileType(t, MP_INDUSTRY);
|
|
_m[t].m1 = 0;
|
|
_m[t].m2 = index;
|
|
_m[t].m3 = 0;
|
|
_m[t].m4 = 0;
|
|
_m[t].m5 = gfx;
|
|
}
|