mirror of https://github.com/OpenTTD/OpenTTD
(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 :Orelease/0.4.5
parent
afb6e5441d
commit
79d29b7633
|
@ -178,7 +178,7 @@ static void DisasterTick_Zeppeliner(Vehicle *v)
|
||||||
0);
|
0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (v->y_pos >= (MapSizeY() + 9) * 16 - 1)
|
if (v->y_pos >= ((int)MapSizeY() + 9) * 16 - 1)
|
||||||
DeleteDisasterVeh(v);
|
DeleteDisasterVeh(v);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -416,7 +416,7 @@ static void DisasterTick_3(Vehicle *v)
|
||||||
GetNewVehiclePos(v, &gp);
|
GetNewVehiclePos(v, &gp);
|
||||||
SetDisasterVehiclePos(v, gp.x, gp.y, v->z_pos);
|
SetDisasterVehiclePos(v, gp.x, gp.y, v->z_pos);
|
||||||
|
|
||||||
if (gp.x > MapSizeX() * 16 + 9*16 - 1) {
|
if (gp.x > (int)MapSizeX() * 16 + 9*16 - 1) {
|
||||||
DeleteDisasterVeh(v);
|
DeleteDisasterVeh(v);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -594,7 +594,7 @@ static void DisasterTick_4b(Vehicle *v)
|
||||||
GetNewVehiclePos(v, &gp);
|
GetNewVehiclePos(v, &gp);
|
||||||
SetDisasterVehiclePos(v, gp.x, gp.y, v->z_pos);
|
SetDisasterVehiclePos(v, gp.x, gp.y, v->z_pos);
|
||||||
|
|
||||||
if (gp.x > MapSizeX() * 16 + 9*16 - 1) {
|
if (gp.x > (int)MapSizeX() * 16 + 9*16 - 1) {
|
||||||
DeleteDisasterVeh(v);
|
DeleteDisasterVeh(v);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
6
misc.c
6
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)
|
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);
|
uint x = GET_TILE_X(tile) + (signed char)(add & 0xFF);
|
||||||
int y = GET_TILE_Y(tile) + ((((0x8080 + add)>>8) & 0xFF) - 0x80);
|
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];
|
char buf[512];
|
||||||
|
|
||||||
sprintf(buf, "TILE_ADD(%s) when adding 0x%.4X and %d failed", exp, tile, add);
|
sprintf(buf, "TILE_ADD(%s) when adding 0x%.4X and %d failed", exp, tile, add);
|
||||||
|
|
2
ttd.c
2
ttd.c
|
@ -1240,8 +1240,6 @@ bool AfterLoadGame(uint version)
|
||||||
BEGIN_TILE_LOOP(tile_cur, w, h, tile)
|
BEGIN_TILE_LOOP(tile_cur, w, h, tile)
|
||||||
if (IS_TILETYPE(tile_cur, MP_WATER) && _map_owner[tile_cur] >= MAX_PLAYERS)
|
if (IS_TILETYPE(tile_cur, MP_WATER) && _map_owner[tile_cur] >= MAX_PLAYERS)
|
||||||
_map_owner[tile_cur] = OWNER_WATER;
|
_map_owner[tile_cur] = OWNER_WATER;
|
||||||
if (!IS_TILETYPE(tile_cur, MP_WATER) && _map_owner[tile_cur] == OWNER_WATER)
|
|
||||||
_map_owner[tile_cur] = OWNER_NONE;
|
|
||||||
END_TILE_LOOP(tile_cur, w, h, tile)
|
END_TILE_LOOP(tile_cur, w, h, tile)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue