Permalink
Browse files

Fix robot iterating bug.

robot_list[0] is the global robot, it was being counted for each board.
Relatedly, the board robots start at robot_list[1], not robot_list[0].
  • Loading branch information...
1 parent 37b7375 commit 7ea2c1ab2f7a990832eb1fb4fb5c6312739beb92 nooodl committed Aug 1, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/world.c
View
@@ -92,7 +92,7 @@ void analyze_robotic(struct world *mzx_world)
struct robot *robot;
for (i = 0; i < mzx_world->num_boards; i++) {
board = mzx_world->board_list[i];
- for (j = 0; j < board->num_robots; j++) {
+ for (j = (i == 0 ? 0 : 1); j <= board->num_robots; j++) {
robot = board->robot_list[j];
disassemble_file(NULL, robot->program_bytecode,
robot->program_bytecode_length, 0, 10);

0 comments on commit 7ea2c1a

Please sign in to comment.