Loading

Paste #pk9ivwxv6

  1. static inline Owner GetCanalOwner(TileIndex t)
  2. {
  3.     assert(HasTileWaterGround(t));
  4.  
  5.     if (GetWaterClass(t) != WATER_CLASS_CANAL) {
  6.         return GetTileOwner(t);
  7.         } else {
  8.         Owner co = (Owner)0;
  9.         SB(co, 0, 2, GB(_me[t].m6, 0, 2));
  10.         SB(co, 2, 2, GB(_me[t].m6, 6, 2));
  11.         return co == OWNER_TOWN ? OWNER_NONE : co;
  12.     }
  13. }
  14.  
  15. static inline void SetCanalOwner(TileIndex t, Owner co)
  16. {
  17.     assert(HasTileWaterGround(t));
  18.  
  19.     if (GetWaterClass(t) != WATER_CLASS_CANAL) {
  20.         SetTileOwner(t, co);
  21.     } else {
  22.         if (co == OWNER_NONE) co = OWNER_TOWN;
  23.         SB(_me[t].m6, 0, 2, GB(co, 0, 2));
  24.         SB(_me[t].m6, 6, 2, GB(co, 2, 2));
  25.     }
  26. }

Comments