From c3ec746a63106256524827a3a244ed17a93efc5a Mon Sep 17 00:00:00 2001 From: Josh Freeman Date: Wed, 2 Dec 2015 17:47:19 +0000 Subject: [PATCH] Update map_coordinates.md --- research/map_coordinates.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/research/map_coordinates.md b/research/map_coordinates.md index 89a793df0..f4b77d828 100644 --- a/research/map_coordinates.md +++ b/research/map_coordinates.md @@ -74,10 +74,12 @@ function mapsTranslateXYZToGame($x, $y, $scale, $tilescale = 50) And finally, to translate an in game X/Y to a `levels.exd` position which can then be converted to a 2D or Long/Lat: ```php -function mapsTranslateGameToXYZ($x, $y) +function mapsTranslateGameToXYZ($x, $y, $scale) { - $x = ($x*50)-25-1024; - $y = ($y*50)-25-1024; + $scale = $scale / 100; + + $x = ($x*50)-25-(1024 / $scale); + $y = ($y*50)-25-(1024 / $scale); return [ 'x' => $x,