From 4a271518149cba9522172e408e57a0d75099388e Mon Sep 17 00:00:00 2001 From: tomsmeding Date: Tue, 14 Mar 2017 19:31:44 +0100 Subject: Check for iset and mobile when executing instrs --- world.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/world.cpp b/world.cpp index 63ba3c1..7f78253 100644 --- a/world.cpp +++ b/world.cpp @@ -145,6 +145,7 @@ WorldAction Robot::execute(Instruction &ins,World &world){ break; case ins_t::trans:{ + assert(iset>=1); Robot *r=world.targetbot(this); if(r){ assert(ins.args[0].num>=1&&ins.args[0].num<=(int)banks.size()&& @@ -167,6 +168,7 @@ WorldAction Robot::execute(Instruction &ins,World &world){ return WorldAction::die; case ins_t::move: + assert(mobile); if(world.targetbot(this)==nullptr){ action=WorldAction::move; } @@ -178,6 +180,7 @@ WorldAction Robot::execute(Instruction &ins,World &world){ break; case ins_t::scan:{ + assert(iset>=1); Robot *r=world.targetbot(this); uint16_t *v=resolveVar(ins.args[0],world); if(!v)break; @@ -191,6 +194,7 @@ WorldAction Robot::execute(Instruction &ins,World &world){ } case ins_t::create: + assert(iset>=2); if(world.targetbot(this)!=nullptr)break; assert(ins.args[0].num>=0&&ins.args[0].num<=2); assert(ins.args[1].num>=0); -- cgit v1.2.3-70-g09d2