From 144cc0ba6b0fbbe2452e8e84e27c1aca9c29aff1 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sat, 28 Dec 2019 10:10:51 +0100 Subject: [PATCH] fix: remove crash due to wrapping --- .../scenes/subgame/sonic-boost/controller/world.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sonic-bluestreak.love/scenes/subgame/sonic-boost/controller/world.lua b/sonic-bluestreak.love/scenes/subgame/sonic-boost/controller/world.lua index 287e570..110c20f 100644 --- a/sonic-bluestreak.love/scenes/subgame/sonic-boost/controller/world.lua +++ b/sonic-bluestreak.love/scenes/subgame/sonic-boost/controller/world.lua @@ -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