diff --git a/ScreenshotMetadata.cs b/ScreenshotMetadata.cs index 789fb1f..bd61a07 100644 --- a/ScreenshotMetadata.cs +++ b/ScreenshotMetadata.cs @@ -134,8 +134,8 @@ public class Character { this.HomeWorldId = player.HomeWorld.Id; this.RawPosition = player.Position; this.MapPosition = new Vector3( - ConvertRawPositionToMapCoordinate(player.Position.X * 1_000, scale, offsetX), - ConvertRawPositionToMapCoordinate(player.Position.Z * 1_000, scale, offsetY), + ConvertRawPositionToMapCoordinate(player.Position.X, scale, offsetX), + ConvertRawPositionToMapCoordinate(player.Position.Z, scale, offsetY), player.Position.Y // TODO: how does map Z coord work ); this.Level = player.Level; @@ -144,9 +144,8 @@ public class Character { } private static float ConvertRawPositionToMapCoordinate(float pos, float scale, short offset) { - var num1 = scale / 100f; - var num2 = (pos / 1000f + offset) * num1; - return (float) (41.0 / num1 * ((num2 + 1024.0) / 2048.0) + 1.0); + var num2 = (pos + offset) * scale; + return (float) (41.0 / scale * ((num2 + 1024.0) / 2048.0) + 1.0); } }