From 7b93b550e5072ab6f4d1c23ac2e9923b4e87362d Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Sun, 28 Aug 2022 17:53:36 -0400 Subject: [PATCH] Actually halt machine when a function returns true --- creature.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/creature.go b/creature.go index 6dcf1c1..ce58b6b 100644 --- a/creature.go +++ b/creature.go @@ -169,7 +169,9 @@ func (machine *Machine) Execute(offset int) { } function, exists := machine.functions[id] if exists { - function(machine) + if function(machine) { + return + } } } machine.counter++