calc_push op loop golf

Reorganizing conditionals saves tokens here.
This commit is contained in:
Kistaro Windrider 2023-01-02 15:58:23 -08:00
parent d792831370
commit 78f0a96529
Signed by: kistaro
SSH Key Fingerprint: SHA256:TBE2ynfmJqsAf0CP6gsflA0q5X5wD5fVKWPsZ7eVUg8

View File

@ -1690,17 +1690,11 @@ 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 if not level:can_move(false,o,0,0) then
local crate=level:get_crate(mx,my) add(blocked,o)
if crate then
if not level:can_move(false,o,0,0) then
add(blocked,o)
break
end
else
break break
end end
add(ops2,o) add(ops2,o)