1
0
Fork 0

(svn r5883) -Fix [FS#272]: use the height of the edge of the map for shadows of aircrafts that are outside the map; similar to r5841, caused by r5794.

release/0.5
rubidium 2006-08-13 14:46:16 +00:00
parent e885129ab8
commit 4b030f190c
1 changed files with 8 additions and 4 deletions

View File

@ -764,7 +764,8 @@ static void HelicopterTickHandler(Vehicle *v)
static void SetAircraftPosition(Vehicle *v, int x, int y, int z) static void SetAircraftPosition(Vehicle *v, int x, int y, int z)
{ {
Vehicle *u; Vehicle *u;
int yt; int safe_x;
int safe_y;
v->x_pos = x; v->x_pos = x;
v->y_pos = y; v->y_pos = y;
@ -779,10 +780,13 @@ static void SetAircraftPosition(Vehicle *v, int x, int y, int z)
u = v->next; u = v->next;
yt = y - ((v->z_pos-GetSlopeZ(x, y-1)) >> 3); safe_x = clamp(x, 0, MapMaxX() * TILE_SIZE);
safe_y = clamp(y - 1, 0, MapMaxY() * TILE_SIZE);
u->x_pos = x; u->x_pos = x;
u->y_pos = yt; u->y_pos = y - ((v->z_pos-GetSlopeZ(safe_x, safe_y)) >> 3);;
u->z_pos = GetSlopeZ(x,yt);
safe_y = clamp(u->y_pos, 0, MapMaxY() * TILE_SIZE);
u->z_pos = GetSlopeZ(safe_x, safe_y);
u->cur_image = v->cur_image; u->cur_image = v->cur_image;
BeginVehicleMove(u); BeginVehicleMove(u);