summaryrefslogtreecommitdiff
path: root/smallmap_gui.c
diff options
context:
space:
mode:
authorKUDr <kudr@openttd.org>2006-11-16 12:31:38 +0000
committerKUDr <kudr@openttd.org>2006-11-16 12:31:38 +0000
commit2cc0c4b3444c81ac01926840c8098b18250ae9a6 (patch)
tree10f2b2e32ae1b02ff18ced818c782dca7fc138b0 /smallmap_gui.c
parenta9312f348c18e644ba7d2b4f8bf2ddcf17955cca (diff)
downloadopenttd-2cc0c4b3444c81ac01926840c8098b18250ae9a6.tar.xz
(svn r7166) -Fix: [FS#402] MiniMap was misplacing vehicles sometimes (HMage)
Diffstat (limited to 'smallmap_gui.c')
-rw-r--r--smallmap_gui.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/smallmap_gui.c b/smallmap_gui.c
index e955e5d0f..277d51ec7 100644
--- a/smallmap_gui.c
+++ b/smallmap_gui.c
@@ -695,8 +695,8 @@ skip_column:
(v->vehstatus & (VS_HIDDEN | VS_UNCLICKABLE)) == 0) {
// Remap into flat coordinates.
Point pt = RemapCoords(
- (v->x_pos - WP(w,smallmap_d).scroll_x) / TILE_SIZE,
- (v->y_pos - WP(w,smallmap_d).scroll_y) / TILE_SIZE,
+ v->x_pos / TILE_SIZE - WP(w,smallmap_d).scroll_x / TILE_SIZE, // divide each one separately because (a-b)/c != a/c-b/c in integer world
+ v->y_pos / TILE_SIZE - WP(w,smallmap_d).scroll_y / TILE_SIZE, // dtto
0);
x = pt.x;
y = pt.y;