diff options
author | tron <tron@openttd.org> | 2006-05-09 09:56:09 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2006-05-09 09:56:09 +0000 |
commit | c9defc0fea20dc900c0c6d3f8aac8984b024052f (patch) | |
tree | 559b2b4b3e046cf2cb59f9c2eacbb8ea4f57cbb5 /vehicle.c | |
parent | e5bd292dabdf5bbf58e5ce83c13688bbe047a62a (diff) | |
download | openttd-c9defc0fea20dc900c0c6d3f8aac8984b024052f.tar.xz |
(svn r4790) Remove slope magic from EnsureNoVehicleZ() and rename it to EnsureNoVehicleOnGround() to make more clear what it does
Diffstat (limited to 'vehicle.c')
-rw-r--r-- | vehicle.c | 17 |
1 files changed, 3 insertions, 14 deletions
@@ -131,30 +131,19 @@ static void *EnsureNoVehicleProcZ(Vehicle *v, void *data) const TileInfo *ti = data; if (v->tile != ti->tile || v->type == VEH_Disaster) return NULL; - if (!IS_INT_INSIDE(ti->z - v->z_pos, 0, TILE_HEIGHT + 1)) return NULL; + if (v->z_pos > ti->z) return NULL; VehicleInTheWayErrMsg(v); return v; } -static inline uint Correct_Z(Slope tileh) -{ - // needs z correction for slope-type graphics that have the NORTHERN tile lowered - return CorrectZ(tileh) ? TILE_HEIGHT : 0; -} - -uint GetCorrectTileHeight(TileIndex tile) -{ - return Correct_Z(GetTileSlope(tile, NULL)); -} -bool EnsureNoVehicleZ(TileIndex tile, byte z) +bool EnsureNoVehicleOnGround(TileIndex tile) { TileInfo ti; ti.tile = tile; - ti.z = z + GetCorrectTileHeight(tile); - + ti.z = GetTileMaxZ(tile); return VehicleFromPos(tile, &ti, EnsureNoVehicleProcZ) == NULL; } |