fix: remove crash due to wrapping
This commit is contained in:
parent
f36f178890
commit
144cc0ba6b
1 changed files with 2 additions and 2 deletions
|
@ -332,7 +332,7 @@ function World:getChunkData(chunkid, turn)
|
|||
return self:getFakeChunk()
|
||||
else
|
||||
chunkid = (chunkid - 1)
|
||||
chunkid = utils.math.wrap(chunkid, 0, #self.chunks)
|
||||
chunkid = chunkid % #self.chunks
|
||||
return self.chunks[chunkid + 1], true
|
||||
end
|
||||
elseif chunkid > #self.chunks then
|
||||
|
@ -340,7 +340,7 @@ function World:getChunkData(chunkid, turn)
|
|||
return self:getFakeChunk()
|
||||
else
|
||||
chunkid = (chunkid - 1)
|
||||
chunkid = utils.math.wrap(chunkid, 0, #self.chunks)
|
||||
chunkid = chunkid % #self.chunks
|
||||
return self.chunks[chunkid + 1], true
|
||||
end
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue