main #21

Closed
kistaro wants to merge 76 commits from main into some_level
Showing only changes of commit fa5c13eb0d - Show all commits

View File

@ -1178,17 +1178,13 @@ function would_stick(anchor,x0,y0,x1,y1,x2,y2)
local dprop=(x1-x0)/dx local dprop=(x1-x0)/dx
x1_new,y1_new=x1,y0+dprop*(y2-y0) x1_new,y1_new=x1,y0+dprop*(y2-y0)
ady=sgn0(y1_new-y1) ady=sgn0(y1_new-y1)
adx=0 adx=sgn0(y0-y2)*ady
if (y0>y2) adx=ady
if (y0<y2) adx=-ady
else else
if (y0>y2) dy,x0,y0,x2,y2=-dy,x2,y2,x0,y0 if (y0>y2) dy,x0,y0,x2,y2=-dy,x2,y2,x0,y0
local dprop=(y1-y0)/dy local dprop=(y1-y0)/dy
x1_new,y1_new=x0+dprop*(x2-x0),y1 x1_new,y1_new=x0+dprop*(x2-x0),y1
adx=sgn0(x1_new-x1) adx=sgn0(x1_new-x1)
ady=0 ady=sgn0(x0-x2)*adx
if (x0>x2) ady=adx
if (x0<x2) ady=-adx
end end
local wouldnt=anchor==nil or (anchor.adx!=adx or anchor.ady!=ady) local wouldnt=anchor==nil or (anchor.adx!=adx or anchor.ady!=ady)