summaryrefslogtreecommitdiff
path: root/misc.c
diff options
context:
space:
mode:
authordarkvater <darkvater@openttd.org>2005-01-03 19:09:45 +0000
committerdarkvater <darkvater@openttd.org>2005-01-03 19:09:45 +0000
commit79d29b7633da52647b7ad4a36fb016ee0cf13801 (patch)
tree6fa0db434c875329084cdf6443b7cf1c56cb6166 /misc.c
parentafb6e5441d94b4be5ebc5655406b0c18af5af74a (diff)
downloadopenttd-79d29b7633da52647b7ad4a36fb016ee0cf13801.tar.xz
(svn r1346) -Fix: fix signed/unsigned warnings
-Fix: latent removal of 2 lines from ttd.c which I forgot because the file was not saved :O
Diffstat (limited to 'misc.c')
-rw-r--r--misc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/misc.c b/misc.c
index 2431b0028..3f6d337a3 100644
--- a/misc.c
+++ b/misc.c
@@ -737,10 +737,10 @@ int FindFirstBit(uint32 value)
extern uint SafeTileAdd(uint tile, int add, const char *exp, const char *file, int line)
{
- int x = GET_TILE_X(tile) + (signed char)(add & 0xFF);
- int y = GET_TILE_Y(tile) + ((((0x8080 + add)>>8) & 0xFF) - 0x80);
+ uint x = GET_TILE_X(tile) + (signed char)(add & 0xFF);
+ uint y = GET_TILE_Y(tile) + ((((0x8080 + add)>>8) & 0xFF) - 0x80);
- if (x < 0 || y < 0 || x >= MapSizeX() || y >= MapSizeY()) {
+ if (x >= MapSizeX() || y >= MapSizeY()) {
char buf[512];
sprintf(buf, "TILE_ADD(%s) when adding 0x%.4X and %d failed", exp, tile, add);