Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 28, 2011, 11:19:02 AM (13 years ago)
Author:
dafrick
Message:

Gametype status notifications now working.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/tutoriallevel3/src/orxonox/gametypes/Gametype.cc

    r8453 r8634  
    5858
    5959        this->defaultControllableEntity_ = Class(Spectator);
    60 
    61         this->bFirstTick_ = true;
    6260       
    6361        this->bAutoStart_ = false;
     
    114112        SUPER(Gametype, tick, dt);
    115113
    116         // Activate the GametypeInfo.
    117         if(this->bFirstTick_)
    118         {
    119             this->gtinfo_->setActive(true);
    120             this->bFirstTick_ = false;
    121         }
    122 
    123114        //count timer
    124115        if (timerIsActive_)
     
    134125
    135126        if (!this->gtinfo_->hasStarted())
     127        {
     128            for (std::map<PlayerInfo*, Player>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)
     129            {
     130                // Inform the GametypeInfo that the player is ready to spawn.
     131                if(it->first->isHumanPlayer() && it->first->isReadyToSpawn())
     132                    this->gtinfo_->playerReadyToSpawn(it->first);
     133            }
     134                   
    136135            this->checkStart();
     136        }
    137137        else if (!this->gtinfo_->hasEnded())
    138138            this->spawnDeadPlayersIfRequested();
     
    182182    {
    183183        this->players_[player].state_ = PlayerState::Joined;
     184        this->gtinfo_->playerEntered(player);
    184185    }
    185186
     
    396397                        if (it->first->isHumanPlayer())
    397398                            hashumanplayers = true;
    398 
    399                         // Inform the GametypeInfo that the player is ready to spawn.
    400                         // TODO: Can it happen, that that changes?
    401                         if(it->first->isHumanPlayer() && it->first->isReadyToSpawn())
    402                             this->gtinfo_->playerReadyToSpawn(it->first);
    403399                    }
    404400                    if (allplayersready && hashumanplayers)
Note: See TracChangeset for help on using the changeset viewer.