round up to the nearest mapblock for player positions

fixes #61
This commit is contained in:
Thomas Rudin 2019-12-01 10:50:40 +01:00
parent 8e3b5280ba
commit 752e25730a

View File

@ -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*/){