calc_push op loop golf
Reorganizing conditionals saves tokens here.
This commit is contained in:
parent
d792831370
commit
78f0a96529
@ -1690,19 +1690,13 @@ function rope:_calc_push(
|
|||||||
|
|
||||||
local ops2,blocked={},{}
|
local ops2,blocked={},{}
|
||||||
for o in all(ops) do
|
for o in all(ops) do
|
||||||
local mx,my,dmx,dmy=unpack(o)
|
local mx,my=unpack(o)
|
||||||
if not level:mcoll(mx,my) then
|
if level:mcoll(mx,my)
|
||||||
-- great!
|
if not (level:get_crate(mx, my)) break
|
||||||
else
|
|
||||||
local crate=level:get_crate(mx,my)
|
|
||||||
if crate then
|
|
||||||
if not level:can_move(false,o,0,0) then
|
if not level:can_move(false,o,0,0) then
|
||||||
add(blocked,o)
|
add(blocked,o)
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
else
|
|
||||||
break
|
|
||||||
end
|
|
||||||
add(ops2,o)
|
add(ops2,o)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user