Fix isRaceOver in CTF

This commit is contained in:
Benau 2018-08-17 16:46:56 +08:00
parent 5104ffe0eb
commit afe5bc2a16
3 changed files with 10 additions and 4 deletions

View File

@ -109,9 +109,14 @@ video::SColor CaptureTheFlag::getColor(unsigned int kart_id) const
// ----------------------------------------------------------------------------
bool CaptureTheFlag::isRaceOver()
{
if (NetworkConfig::get()->isServer() &&
if (NetworkConfig::get()->isNetworking() &&
NetworkConfig::get()->isClient())
return false;
if ((m_count_down_reached_zero && race_manager->hasTimeTarget()) ||
(m_red_scores >= race_manager->getHitCaptureLimit() ||
m_blue_scores >= race_manager->getHitCaptureLimit()))
return true;
return FreeForAll::isRaceOver();
return false;
} // isRaceOver

View File

@ -27,9 +27,10 @@ class NetworkString;
class FreeForAll : public WorldWithRank
{
private:
protected:
bool m_count_down_reached_zero;
private:
std::vector<int> m_scores;
// ------------------------------------------------------------------------

View File

@ -88,7 +88,7 @@ public:
*/
enum MajorRaceModeType
{
MAJOR_MODE_GRAND_PRIX,
MAJOR_MODE_GRAND_PRIX = 0,
MAJOR_MODE_SINGLE,
MAJOR_MODE_FREE_FOR_ALL,
MAJOR_MODE_CAPTURE_THE_FLAG,