TIC-80
TIC-80 copied to clipboard
BOOT() doesn't throw errors until TIC() runs
There is some weird behaviour where if an error happens during BOOT it will not being thrown until TIC() runs for the first time. The problem is if something during TIC() relies on stuff that were supposed to be set on BOOT, this other error will be thrown instead. A simple example to reproduce it would be this:
function BOOT()
error('BOOT error')
end
function TIC()
error('TIC error')
end
This will show the "TIC error", but if you remove it then the "BOOT error" appears
hmm, I see both errors
So I assume it is fixed then, since this happens on the latest release version (1.0.2164). But just to make sure, TIC error should NOT appear if the BOOT error happens first.
I think this is a limitation to how the callbacks work... BOOT is just fired - and then TIC is fired... I don't recall there being a check after each callback to see if there was an error raised during that callback that should stop the VM. I think that check might only be on TIC itself. That's my guess at least.
Okay, only now i realized it shows both errors but the second error will almost always be irrelevant or making no sense at all if it is caused by BOOT failing
Okay, only now i realized it shows both errors
Yeah, I'd say that's a bug we should fix... that is BOOT hits an error, runtime is suspended before TIC is called.