# HG changeset patch # User rubidium # Date 1183986604 0 # Node ID 4eb40d6fa23f085f5d21ca189076ce29aa6318e1 # Parent f0feec5382ac0136af2ef7404c1236de32934d61 (svn r10484) -Codechange: reduce code duplication. diff --git a/src/newgrf_canal.cpp b/src/newgrf_canal.cpp --- a/src/newgrf_canal.cpp +++ b/src/newgrf_canal.cpp @@ -7,6 +7,7 @@ #include "debug.h" #include "newgrf.h" #include "newgrf_callbacks.h" +#include "newgrf_commons.h" #include "newgrf_spritegroup.h" #include "newgrf_canal.h" @@ -44,8 +45,7 @@ return TileHeight(tile); case 0x81: - return ((_opt.landscape == LT_ARCTIC && GetTileZ(tile) > GetSnowLine()) ? 4 : 0) | - (_opt.landscape == LT_TROPIC ? GetTropicZone(tile) : 0); + return GetTerrainType(tile); } DEBUG(grf, 1, "Unhandled canal property 0x%02X", variable);