Allow more than 1 player winning in FFA if a tie
This commit is contained in:
parent
6478a0714d
commit
ab94fdfceb
@ -1078,9 +1078,8 @@ void Kart::setRaceResult()
|
||||
}
|
||||
else if (race_manager->getMajorMode() == RaceManager::MAJOR_MODE_FREE_FOR_ALL)
|
||||
{
|
||||
// the top kart wins
|
||||
FreeForAll* ffa = dynamic_cast<FreeForAll*>(World::getWorld());
|
||||
m_race_result = ffa->getKartAtPosition(1) == this;
|
||||
m_race_result = ffa->getKartFFAResult(getWorldKartId());
|
||||
}
|
||||
else if (race_manager->getMajorMode() == RaceManager::MAJOR_MODE_CAPTURE_THE_FLAG)
|
||||
{
|
||||
|
@ -196,3 +196,14 @@ video::SColor FreeForAll::getColor(unsigned int kart_id) const
|
||||
{
|
||||
return GUIEngine::getSkin()->getColor("font::normal");
|
||||
} // getColor
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
bool FreeForAll::getKartFFAResult(int kart_id) const
|
||||
{
|
||||
// the kart(s) which has the top score wins
|
||||
AbstractKart* k = getKartAtPosition(1);
|
||||
if (!k)
|
||||
return false;
|
||||
int top_score = getKartScore(k->getWorldKartId());
|
||||
return getKartScore(kart_id) == top_score;
|
||||
} // getKartFFAResult
|
||||
|
@ -66,6 +66,8 @@ public:
|
||||
void setKartScoreFromServer(NetworkString& ns);
|
||||
// ------------------------------------------------------------------------
|
||||
int getKartScore(int kart_id) const { return m_scores.at(kart_id); }
|
||||
// ------------------------------------------------------------------------
|
||||
bool getKartFFAResult(int kart_id) const;
|
||||
}; // FreeForAll
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user