diff --git a/updatedshmup.p8 b/updatedshmup.p8 index 334c2f8..3f1390f 100644 --- a/updatedshmup.p8 +++ b/updatedshmup.p8 @@ -66,12 +66,13 @@ end -- vore eats another linked list -- by appending its contents. --- the ingested linked --- list is no longer valid. +-- the ingested linked is empty. function linked_list:vore(x) if (not x.next) return self.tail.next = x.next self.tail = x.tail + x.next = nil + x.tail = x end -- strip calls f(x) for each @@ -153,6 +154,7 @@ function wipe_level() intangibles_fg = linked_list.new() intangibles_bg = linked_list.new() events = linked_list.new() + new_events = linked_list.new() end function _update60() @@ -169,9 +171,8 @@ end function updategame() leveldone = level_frame() - new_events = linked_list.new() - events:strip(call_move) events:vore(new_events) + events:strip(call_move) for _, lst in ipairs{intangibles_bg, pships, eships, pbullets, ebullets} do lst:strip(call_move) end