Reduce CPU hit of level rebuild

This commit is contained in:
Pyrex 2023-01-02 20:51:06 -08:00
parent 9960aafd71
commit 20a1feb2bb

View File

@ -432,11 +432,13 @@ function level:recollide_reanchor()
for my0=0,15 do for my0=0,15 do
local mx1,my1=mx0+dx,my0+dy local mx1,my1=mx0+dx,my0+dy
-- bypass mcoll for MEGA SPEED
local c=self._coll
if ( if (
self:mcoll{mx0,my0} and not self:get_crate(mx0,my0) and c[mx0..","..my0] and not self:get_crate(mx0,my0) and
not self:mcoll{mx0,my1} and not c[mx0..","..my1] and
not self:mcoll{mx1,my0} and not c[mx1..","..my0] and
not self:mcoll{mx1,my1} not c[mx1..","..my1]
) then ) then
local key=_mix{"GEOM",mx0,my0,dx,dy} local key=_mix{"GEOM",mx0,my0,dx,dy}
anch_new[key]= { anch_new[key]= {
@ -480,10 +482,6 @@ function level:recollide_reanchor()
if player.rope then if player.rope then
player.rope:experience_anchor_moves(moves) player.rope:experience_anchor_moves(moves)
end end
for point in self:anchor_points() do
point.moved=nil
end
end end
function level:win_at(mx,my) function level:win_at(mx,my)