From 6149ed650b00dde6b91679880ce8cec66c729f8c Mon Sep 17 00:00:00 2001 From: tomsmeding Date: Wed, 1 Mar 2017 22:43:42 +0100 Subject: Fix bugs --- world.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/world.cpp b/world.cpp index b1d5e75..17e63a2 100644 --- a/world.cpp +++ b/world.cpp @@ -20,10 +20,14 @@ void Robot::load(int idx,const Script &scr){ WorldAction Robot::tick(World &world){ if(active==0)return WorldAction::none; // TODO: check whether `waited` needs to be reset + if(!ipInRange()){ + ip.bank=ip.pos=0; + assert(ipInRange()); + } waited++; Instruction ins=resolve(world); int dur=calcDuration(ins); - if(dur