fix lit dynamite crash

This commit is contained in:
Timothy Stiles 2021-02-14 19:27:06 +11:00
parent d6e43a70ca
commit 931f3c19c7
2 changed files with 16 additions and 12 deletions

View File

@ -2458,6 +2458,9 @@ export class Level extends LevelInterface {
//update static_on_tic_tiles //update static_on_tic_tiles
//TODO: if which on_tic happens first ever matters, this will introduce a time travel bug where the order is changed by changing tiles then undoing that. hmm //TODO: if which on_tic happens first ever matters, this will introduce a time travel bug where the order is changed by changing tiles then undoing that. hmm
//ignore actors (because e.g. lit_dynamite gets called every tic because it's an actor)
if (!new_type.is_actor)
{
if (old_type.on_tic && !new_type.on_tic) if (old_type.on_tic && !new_type.on_tic)
{ {
//search array and remove //search array and remove
@ -2475,6 +2478,7 @@ export class Level extends LevelInterface {
//add to end of array //add to end of array
this.static_on_tic_tiles.push(tile); this.static_on_tic_tiles.push(tile);
} }
}
//TODO: update circuit networks? //TODO: update circuit networks?
} }