static inline void SetCanalOwner(TileIndex t, Owner o)
{
assert(GetWaterClass(t) == WATER_CLASS_CANAL);
assert(o != OWNER_TOWN);
assert(o != OWNER_DEITY);
/* OWNER_NONE (10) and OWNER_WATER (11) is stored as OWNER_TOWN (0F) */
if (o == OWNER_NONE) o = OWNER_TOWN;
SB(_me[t].m6, 0, 2, GB(o, 0, 2));
SB(_me[t].m6, 6, 2, GB(o, 2, 2));
}
static inline Owner GetCanalOwner(TileIndex t)
{
assert(HasTileWaterGround(t) && GetWaterClass(t) == WATER_CLASS_CANAL);
Owner o = (Owner)(GB(_me[t].m6, 0, 2) | (GB(_me[t].m6, 6, 2) << 2));
/* Canals don't need OWNER_TOWN, and remapping OWNER_NONE
* to OWNER_TOWN makes it use one bit less. */
return o == OWNER_TOWN ? OWNER_NONE : o;
}