mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-04 06:00:15 +00:00
(svn r7448) -Fix (r5794): use the height of the edge of the map for effect vehicles that are outside the map.
This commit is contained in:
parent
a3bd9251ae
commit
9a0917141b
@ -1431,7 +1431,9 @@ Vehicle *CreateEffectVehicle(int x, int y, int z, EffectVehicle type)
|
||||
|
||||
Vehicle *CreateEffectVehicleAbove(int x, int y, int z, EffectVehicle type)
|
||||
{
|
||||
return CreateEffectVehicle(x, y, GetSlopeZ(x, y) + z, type);
|
||||
int safe_x = clamp(x, 0, MapMaxX() * TILE_SIZE);
|
||||
int safe_y = clamp(y, 0, MapMaxY() * TILE_SIZE);
|
||||
return CreateEffectVehicle(x, y, GetSlopeZ(safe_x, safe_y) + z, type);
|
||||
}
|
||||
|
||||
Vehicle *CreateEffectVehicleRel(const Vehicle *v, int x, int y, int z, EffectVehicle type)
|
||||
|
Loading…
Reference in New Issue
Block a user