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/AddQuestHint.cc

    r2021 r2068  
    2828
    2929#include "core/CoreIncludes.h"
     30#include "util/Exception.h"
    3031
    3132#include "QuestManager.h"
     
    6667    @param player
    6768        The player.
     69    @return
     70        Returns true if the effect was successfully invoked.
    6871    */
    69     void AddQuestHint::invoke(Player* player)
     72    bool AddQuestHint::invoke(Player* player)
    7073    {
    71         QuestHint* hint = QuestManager::findHint(this->hintId_);
    72         hint->activate(player);
     74        if(player == NULL)
     75        {
     76            COUT(2) << "The input player is NULL." << std::endl;
     77            return false;
     78        }
     79
     80        try
     81        {
     82            QuestHint* hint = QuestManager::findHint(this->hintId_);
     83            if(!hint->activate(player))
     84            {
     85                return false;
     86            }
     87        }
     88        catch(const Exception& e)
     89        {
     90           COUT(2) << e.getFullDescription() << std::endl;
     91           return false;
     92        }
     93       
     94        return true;
     95       
    7396    }
    7497}
Note: See TracChangeset for help on using the changeset viewer.