From 752e25730a43dcec60f9569e8b4b079cd44e5098 Mon Sep 17 00:00:00 2001 From: Thomas Rudin Date: Sun, 1 Dec 2019 10:50:40 +0100 Subject: [PATCH] round up to the nearest mapblock for player positions fixes #61 --- static/js/map/overlays/PlayerOverlay.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/static/js/map/overlays/PlayerOverlay.js b/static/js/map/overlays/PlayerOverlay.js index 6fa56c8..4136734 100644 --- a/static/js/map/overlays/PlayerOverlay.js +++ b/static/js/map/overlays/PlayerOverlay.js @@ -64,7 +64,10 @@ export default L.LayerGroup.extend({ isPlayerInCurrentLayer: function(player){ var mapLayer = layerMgr.getCurrentLayer(); - return (player.pos.y >= (mapLayer.from*16) && player.pos.y <= (mapLayer.to*16)); + return ( + player.pos.y >= (mapLayer.from*16) && + player.pos.y <= ((mapLayer.to*16) + 15) + ); }, onMinetestUpdate: function(/*info*/){