From 88e15d910063ad6584cd5cf0f06f77dc8b897d0e Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Fri, 15 Jan 2016 00:03:00 +0000 Subject: [PATCH] Fix voxel z offsets. --- OpenRA.Game/Graphics/WorldRenderer.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OpenRA.Game/Graphics/WorldRenderer.cs b/OpenRA.Game/Graphics/WorldRenderer.cs index 8e19c73ba5..e1f305c20c 100644 --- a/OpenRA.Game/Graphics/WorldRenderer.cs +++ b/OpenRA.Game/Graphics/WorldRenderer.cs @@ -219,7 +219,7 @@ namespace OpenRA.Graphics public void ScreenVectorComponents(WVec vec, out float x, out float y, out float z) { x = TileSize.Width * vec.X / 1024f; - y = TileSize.Height * vec.Y / 1024f; + y = TileSize.Height * (vec.Y - vec.Z) / 1024f; z = TileSize.Height * vec.Z / 1024f; } @@ -236,7 +236,7 @@ namespace OpenRA.Graphics // Round to nearest pixel float x, y, z; ScreenVectorComponents(vec, out x, out y, out z); - return new int2((int)Math.Round(x), (int)Math.Round(y - z)); + return new int2((int)Math.Round(x), (int)Math.Round(y)); } public float ScreenZPosition(WPos pos, int offset)