mirror of
https://github.com/danbulant/flying-squid
synced 2026-07-05 11:10:44 +00:00
convert coords to int, fix chunk unload bug (on node 0.10)
This commit is contained in:
parent
7f47dacc60
commit
6d098deb23
1 changed files with 1 additions and 1 deletions
|
|
@ -114,7 +114,7 @@ module.exports.player=function(player,serv,settings) {
|
||||||
var playerChunkZ=Math.floor(player.position.z/16/32);
|
var playerChunkZ=Math.floor(player.position.z/16/32);
|
||||||
|
|
||||||
Object.keys(player.loadedChunks)
|
Object.keys(player.loadedChunks)
|
||||||
.map((key) => key.split(","))
|
.map((key) => key.split(",").map(a => parseInt(a)))
|
||||||
.filter(([x,z]) => Math.abs(x-playerChunkX)>view || Math.abs(z-playerChunkZ)>view)
|
.filter(([x,z]) => Math.abs(x-playerChunkX)>view || Math.abs(z-playerChunkZ)>view)
|
||||||
.forEach(([x,z]) => player.unloadChunk(x,z));
|
.forEach(([x,z]) => player.unloadChunk(x,z));
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue