Actually halt machine when a function returns true

This commit is contained in:
Sasha Koshka 2022-08-28 17:53:36 -04:00
parent 07a783b6ba
commit 7b93b550e5
1 changed files with 3 additions and 1 deletions

View File

@ -169,7 +169,9 @@ func (machine *Machine) Execute(offset int) {
} }
function, exists := machine.functions[id] function, exists := machine.functions[id]
if exists { if exists {
function(machine) if function(machine) {
return
}
} }
} }
machine.counter++ machine.counter++