Skip to content

Commit

Permalink
128 check doesn't matter
Browse files Browse the repository at this point in the history
  • Loading branch information
Yozzaxia1311 committed Nov 26, 2020
1 parent 7fed866 commit 529ad99
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions core/collision.lua
Original file line number Diff line number Diff line change
Expand Up @@ -450,10 +450,10 @@ function collision.generalCollision(self, noSlope)
if math.sign(self.xColl) == math.sign(xsl) then
local yStep = 1
local xStep = 0
local dst = math.min(math.abs(xsl), 128)
local yTolerance = math.ceil(math.abs(xsl)) * collision.maxSlope
local dst = math.abs(xsl)
local yTolerance = math.ceil(dst) * collision.maxSlope

while true do
while xStep ~= dst do
if self:collisionNumber(solid, xsl - xStep, -yStep) == 0 then
self.transform.x = self.transform.x + xsl - xStep
self.transform.y = self.transform.y - yStep
Expand All @@ -472,10 +472,6 @@ function collision.generalCollision(self, noSlope)
break
end
if yStep > yTolerance then
if xStep == dst then
break
end

yStep = 1
xStep = math.min(xStep + 1, dst)
else
Expand Down

0 comments on commit 529ad99

Please sign in to comment.