Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 12, 2009, 8:20:07 PM (15 years ago)
Author:
rgrieder
Message:

Merged core5 branch back to the trunk.
Key features include clean level unloading and an extended XML event system.

Two important notes:
Delete your keybindings.ini files! * or you will still get parser errors when loading the key bindings.
Delete build_dir/lib/modules/libgamestates.module! * or orxonox won't start.
Best thing to do is to delete the build folder ;)

Location:
code/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/orxonox/gametypes/UnderAttack.cc

    r5781 r5929  
    4646        this->teams_ = 2;
    4747        this->destroyer_ = 0;
     48        this->destroyer_.setCallback(createFunctor(&UnderAttack::killedDestroyer, this));
    4849        this->gameEnded_ = false;
    4950
     
    6566
    6667
    67     void UnderAttack::destroyedPawn(Pawn* pawn)
     68    void UnderAttack::killedDestroyer()
    6869    {
    69         if (pawn == this->destroyer_)
     70        this->end(); //end gametype
     71        std::string message = "Ship destroyed! Team 0 has won!";
     72        COUT(0) << message << std::endl;
     73        Host::Broadcast(message);
     74        this->gameEnded_ = true;
     75
     76        for (std::map<PlayerInfo*, int>::iterator it = this->teamnumbers_.begin(); it != this->teamnumbers_.end(); ++it)
    7077        {
    71             this->end(); //end gametype
    72             std::string message = "Ship destroyed! Team 0 has won!";
    73             COUT(0) << message << std::endl;
    74             Host::Broadcast(message);
    75             this->gameEnded_ = true;
     78            if (it->first->getClientID() == CLIENTID_UNKNOWN)
     79                continue;
    7680
    77             for (std::map<PlayerInfo*, int>::iterator it = this->teamnumbers_.begin(); it != this->teamnumbers_.end(); ++it)
    78             {
    79                 if (it->first->getClientID() == CLIENTID_UNKNOWN)
    80                     continue;
    81 
    82                 if (it->second == 0)
    83                     this->gtinfo_.sendAnnounceMessage("You have won the match!", it->first->getClientID());
    84                 else
    85                     this->gtinfo_.sendAnnounceMessage("You have lost the match!", it->first->getClientID());
    86             }
     81            if (it->second == 0)
     82                this->gtinfo_->sendAnnounceMessage("You have won the match!", it->first->getClientID());
     83            else
     84                this->gtinfo_->sendAnnounceMessage("You have lost the match!", it->first->getClientID());
    8785        }
    8886    }
     
    164162
    165163                    if (it->second == 1)
    166                         this->gtinfo_.sendAnnounceMessage("You have won the match!", it->first->getClientID());
     164                        this->gtinfo_->sendAnnounceMessage("You have won the match!", it->first->getClientID());
    167165                    else
    168                         this->gtinfo_.sendAnnounceMessage("You have lost the match!", it->first->getClientID());
     166                        this->gtinfo_->sendAnnounceMessage("You have lost the match!", it->first->getClientID());
    169167                }
    170168            }
     
    178176                Host::Broadcast(message);
    179177*/
    180                 this->gtinfo_.sendAnnounceMessage(message);
     178                this->gtinfo_->sendAnnounceMessage(message);
    181179
    182180                if (timesequence_ >= 30 && timesequence_ <= 60)
Note: See TracChangeset for help on using the changeset viewer.