Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 30, 2008, 9:52:12 AM (16 years ago)
Author:
dafrick
Message:

Started with XMLPort…

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/questsystem/src/orxonox/objects/AddQuest.cc

    r2021 r2068  
    3030
    3131#include "core/CoreIncludes.h"
     32#include "util/Exception.h"
    3233
    3334#include "QuestManager.h"
     
    6970    @param player
    7071        The player the effect is invoked on.
     72    @return
     73        Returns true if the effect was successfully invoked.
    7174    */
    72     void AddQuest::invoke(Player* player)
     75    bool AddQuest::invoke(Player* player)
    7376    {
    74         Quest* quest = QuestManager::findQuest(this->getQuestId());
    75         quest->start(player);
     77        if(player == NULL)
     78        {
     79            COUT(2) << "Input player is NULL." << std::endl;
     80            return false;
     81        }
     82   
     83        try
     84        {
     85            Quest* quest = QuestManager::findQuest(this->getQuestId());
     86            if(!quest->start(player))
     87            {
     88               return false;
     89            }
     90        }
     91        catch(const orxonox::Exception& ex)
     92        {
     93            COUT(2) << ex.getFullDescription() << std::endl;
     94            return false;
     95        }
     96       
     97        return true;
    7698    }
    7799
Note: See TracChangeset for help on using the changeset viewer.