From 3824c9121aa0bec0ba50718d58fabf89d9830813 Mon Sep 17 00:00:00 2001 From: Noah Petherbridge Date: Tue, 16 Jul 2019 22:10:18 -0700 Subject: [PATCH] Auto-prune Empty Chunks in Level Files * Discovered a bug where if you hit the Undo key to erase pixels and an entire chunk became empty by it, the chunk would have rendering errors and show as a solid black square instead of the level wallpaper showing through. * Chunks that have no pixels in them are culled from the chunker immediately when you call a Delete() operation. * The level file saver also calls a maintenance function to prune all empty chunks upon saving the file. So existing levels with broken chunks need only be re-saved to fix them. --- dev-assets/doodads/objects/exit-flag.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dev-assets/doodads/objects/exit-flag.js b/dev-assets/doodads/objects/exit-flag.js index 056890c..df4aec0 100644 --- a/dev-assets/doodads/objects/exit-flag.js +++ b/dev-assets/doodads/objects/exit-flag.js @@ -4,6 +4,10 @@ function main() { Self.SetHitbox(22+16, 16, 75-16, 86); Events.OnCollide(function(e) { + if (!e.Settled) { + return; + } + if (e.InHitbox) { EndLevel(); }