summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiels Martin Hansen <nielsm@indvikleren.dk>2019-01-05 14:30:59 +0100
committerNiels Martin Hansen <nielsm@indvikleren.dk>2019-01-05 17:21:29 +0100
commitb8b6954fb58aac07d05dabe63918f0392c5672d1 (patch)
tree689eb8ae73d8ecf8188bd414c7bc45fd518cba4a
parentcb60a5e57fb7013b330041d428c53ba7f97e4f92 (diff)
downloadopenttd-b8b6954fb58aac07d05dabe63918f0392c5672d1.tar.xz
Fix 6a3d411: Silence truncation warning
-rw-r--r--src/tunnelbridge_cmd.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/tunnelbridge_cmd.cpp b/src/tunnelbridge_cmd.cpp
index 297a01d30..06dc24e84 100644
--- a/src/tunnelbridge_cmd.cpp
+++ b/src/tunnelbridge_cmd.cpp
@@ -701,10 +701,11 @@ CommandCost CmdBuildTunnel(TileIndex start_tile, DoCommandFlag flags, uint32 p1,
*/
assert(coa >= _cleared_object_areas.Begin() && coa < _cleared_object_areas.End());
size_t coa_index = coa - _cleared_object_areas.Begin();
+ assert(coa_index < UINT_MAX); // more than 2**32 cleared areas would be a bug in itself
coa = NULL;
ret = DoCommand(end_tile, end_tileh & start_tileh, 0, flags, CMD_TERRAFORM_LAND);
- _cleared_object_areas[coa_index].first_tile = old_first_tile;
+ _cleared_object_areas[(uint)coa_index].first_tile = old_first_tile;
if (ret.Failed()) return_cmd_error(STR_ERROR_UNABLE_TO_EXCAVATE_LAND);
cost.AddCost(ret);
}