Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 29, 2013, 8:56:38 PM (11 years ago)
Author:
jo
Message:

Making a Mission endable by a ConsoleCommand such that it can be ended from within a level.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/orxonox/gametypes/Mission.cc

    r9667 r9728  
    3232
    3333#include "core/CoreIncludes.h"
     34#include "core/command/ConsoleCommand.h"
    3435#include "network/Host.h"
    3536#include "worldentities/pawns/Pawn.h"
     
    3738namespace orxonox
    3839{
     40    SetConsoleCommand("Mission", "endMission", &Mission::endMission);
    3941    RegisterUnloadableClass(Mission);
    4042
     
    7880    {
    7981        Gametype::end();
    80         /*if (this->missionAccomplished_)
     82        if (this->missionAccomplished_)
    8183            this->gtinfo_->sendAnnounceMessage("Mission accomplished!");
    8284        else
    8385            this->gtinfo_->sendAnnounceMessage("Mission failed!");
    84         */
    8586    }
    8687
     
    9495        }
    9596    }
    96 
     97    void Mission::endMission(bool accomplished)
     98    {
     99        for (ObjectList<Mission>::iterator it = ObjectList<Mission>::begin(); it != ObjectList<Mission>::end(); ++it)
     100        {//TODO: make sure that only the desired mission is ended !! This is a dirty HACK, that would end ALL missions!
     101            it->setMissionAccomplished(accomplished);
     102            it->end();
     103        }
     104    }
    97105
    98106
Note: See TracChangeset for help on using the changeset viewer.