Fix wrong win message in races only with 1 kart (#4632)

This commit is contained in:
Kuba 2021-09-30 19:57:45 +02:00 committed by GitHub
parent d5f8496abc
commit ca04106253
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1012,8 +1012,8 @@ void Kart::finishedRace(float time, bool from_server)
if (RaceManager::get()->getMinorMode() == RaceManager::MINOR_MODE_FOLLOW_LEADER)
win_position = 2;
if (getPosition() == (int)win_position &&
World::getWorld()->getNumKarts() > win_position)
if ((getPosition() == (int)win_position &&
World::getWorld()->getNumKarts() > win_position) || RaceManager::get()->getNumberOfKarts() == 1)
won_the_race = true;
if (RaceManager::get()->hasTimeTarget() && m_finish_time > RaceManager::get()->getTimeTarget())