diff options
author | tomsmeding <tom.smeding@gmail.com> | 2017-03-14 19:31:44 +0100 |
---|---|---|
committer | tomsmeding <tom.smeding@gmail.com> | 2017-03-14 19:32:07 +0100 |
commit | 4a271518149cba9522172e408e57a0d75099388e (patch) | |
tree | 6b07bbcfacb7c8996774d81142b5bf69911a2698 | |
parent | f2fa26e47654a564493ab4d7b5b2f283a16bdc94 (diff) |
Check for iset and mobile when executing instrs
-rw-r--r-- | world.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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); |