(svn r15750) -Fix: The big ufo sometimes landed just outside the map. Instead of landing, just disappear (fly away) in those cases.

This commit is contained in:
yexo 2009-03-17 01:30:39 +00:00
parent 72dc128915
commit 93be9a1c90
1 changed files with 6 additions and 0 deletions

View File

@ -481,6 +481,12 @@ static void DisasterTick_Big_Ufo(Vehicle *v)
return;
}
if (!IsValidTile(v->dest_tile)) {
/* Make sure we don't land outside the map. */
delete v;
return;
}
byte z = GetSlopeZ(v->x_pos, v->y_pos);
if (z < v->z_pos) {
SetDisasterVehiclePos(v, v->x_pos, v->y_pos, v->z_pos - 1);