static inline Owner GetCanalOwner(TileIndex t) { assert(HasTileWaterGround(t)); if (GetWaterClass(t) != WATER_CLASS_CANAL) { return GetTileOwner(t); } else { Owner co = (Owner)0; SB(co, 0, 2, GB(_me[t].m6, 0, 2)); SB(co, 2, 2, GB(_me[t].m6, 6, 2)); return co == OWNER_TOWN ? OWNER_NONE : co; } } static inline void SetCanalOwner(TileIndex t, Owner co) { assert(HasTileWaterGround(t)); if (GetWaterClass(t) != WATER_CLASS_CANAL) { SetTileOwner(t, co); } else { if (co == OWNER_NONE) co = OWNER_TOWN; SB(_me[t].m6, 0, 2, GB(co, 0, 2)); SB(_me[t].m6, 6, 2, GB(co, 2, 2)); } }