mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r5841) -Fix r5794: use the height of the edge of the map for shadows of disasters that are outside the map
This commit is contained in:
parent
811e79ba4c
commit
bdb64325fd
|
@ -116,7 +116,6 @@ static void DeleteDisasterVeh(Vehicle *v)
|
|||
static void SetDisasterVehiclePos(Vehicle *v, int x, int y, byte z)
|
||||
{
|
||||
Vehicle *u;
|
||||
int yt;
|
||||
|
||||
BeginVehicleMove(v);
|
||||
v->x_pos = x;
|
||||
|
@ -129,11 +128,14 @@ static void SetDisasterVehiclePos(Vehicle *v, int x, int y, byte z)
|
|||
EndVehicleMove(v);
|
||||
|
||||
if ( (u=v->next) != NULL) {
|
||||
int safe_x = clamp(x, 0, MapMaxX() * TILE_SIZE);
|
||||
int safe_y = clamp(y - 1, 0, MapMaxY() * TILE_SIZE);
|
||||
BeginVehicleMove(u);
|
||||
|
||||
u->x_pos = x;
|
||||
u->y_pos = yt = y - 1 - (max(z - GetSlopeZ(x, y-1), 0) >> 3);
|
||||
u->z_pos = GetSlopeZ(x,yt);
|
||||
u->y_pos = y - 1 - (max(z - GetSlopeZ(safe_x, safe_y), 0) >> 3);
|
||||
safe_y = clamp(u->y_pos, 0, MapMaxY() * TILE_SIZE);
|
||||
u->z_pos = GetSlopeZ(safe_x, safe_y);
|
||||
u->direction = v->direction;
|
||||
|
||||
DisasterVehicleUpdateImage(u);
|
||||
|
|
Loading…
Reference in New Issue