Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Thread Modes mysterious try...catch block
#1
I tried try...catch block.
And saw strange work that block.
I have two flags: BlueFlag and VioletFlag, for example.
Distance between two flags about 100m.
My Bot moves between these flags.
Code:
extern void object::test()
{
   try
   {
       while(true)
       {
           goto(radar(VioletFlag).position);
           goto(radar(BlueFlag).position);
       }
   }
   catch(energyCell.energyLevel < 0.8)
   {
       message("Energy low");
       goto(radar(PowerStation).position);
   }
}

When Energy is lower 0.8, message "Energy low" appears, but the Bot continues to moves to one of the flags,
and then moves to the PowerStation.

The goto(radar(xxxFlag).position) command is not interrupted
Why?
#2
It's a known bug. That's why it was never officially documented in original Colobot. See https://github.com/colobot/colobot/issues/474


Forum Jump:


Users browsing this thread: 1 Guest(s)