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.
master
Noah 2019-07-16 22:10:18 -07:00
parent 93b28ccc04
commit 3824c9121a
1 changed files with 4 additions and 0 deletions

View File

@ -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();
}