Skip to content

Commit

Permalink
Set different positions at the turn off procedure to avoid collisions…
Browse files Browse the repository at this point in the history
… of the robots.
  • Loading branch information
ShotaAk authored and g3force committed Feb 24, 2024
1 parent b49a694 commit fbbc672
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/sslworld.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -842,8 +842,9 @@ void SSLWorld::processTeleportRobot(const TeleportRobot &teleBot, Robot *robot)
if (teleBot.has_present()) {
robot->on = teleBot.present();
if(!teleBot.present()) {
// Move it out of the field
robot->setXY(1e6, 1e6);
// Move it out of the field.
// Set different x and y to avoid collisions of the robots.
robot->setXY(1e6 * teleBot.id().id(), 1e6 * teleBot.id().team());
}
}
}
Expand Down

0 comments on commit fbbc672

Please sign in to comment.