From c284d0311a910ca2a845d5ec6fbbcdf1029d0a42 Mon Sep 17 00:00:00 2001 From: ShotaAk Date: Fri, 23 Feb 2024 00:20:23 +0900 Subject: [PATCH] Set different positions at the turn off procedure to avoid collisions of the robots. --- src/sslworld.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/sslworld.cpp b/src/sslworld.cpp index 5cc33755..ab14858f 100644 --- a/src/sslworld.cpp +++ b/src/sslworld.cpp @@ -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()); } } }