Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 14, 2011, 10:10:26 AM (13 years ago)
Author:
dafrick
Message:

Adding some asserts.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/ai2/src/modules/questsystem/QuestManager.cc

    r8839 r8841  
    3535
    3636#include "util/Exception.h"
     37#include "util/OrxAssert.h"
    3738#include "util/ScopedSingletonManager.h"
    3839#include "core/command/ConsoleCommand.h"
     
    99100    bool QuestManager::registerQuest(Quest* quest)
    100101    {
    101         assert(quest);
     102        if(quest == NULL)
     103        {
     104            COUT(1) << "Quest pointer is NULL." << endl;
     105            return false;
     106        }
    102107
    103108        std::pair<std::map<std::string, Quest*>::iterator,bool> result;
     
    137142    bool QuestManager::registerHint(QuestHint* hint)
    138143    {
    139         assert(hint);
     144        if(hint == NULL)
     145        {
     146            COUT(1) << "Hint pointer is NULL." << endl;
     147            return false;
     148        }
    140149
    141150        std::pair<std::map<std::string, QuestHint*>::iterator,bool> result;
     
    365374    Quest* QuestManager::getParentQuest(Quest* quest)
    366375    {
     376        OrxAssert(quest, "The input Quest is NULL.");
    367377        return quest->getParentQuest();
    368378    }
     
    378388    QuestDescription* QuestManager::getDescription(Quest* item)
    379389    {
     390        OrxAssert(item, "The input Quest is NULL.");
    380391        return item->getDescription();
    381392    }
     
    391402    QuestDescription* QuestManager::getDescription(QuestHint* item)
    392403    {
     404        OrxAssert(item, "The input QuestHint is NULL.");
    393405        return item->getDescription();
    394406    }
     
    404416    const std::string QuestManager::getId(Quest* item) const
    405417    {
     418        OrxAssert(item, "The input Quest is NULL.");
    406419        return item->getId();
    407420    }
     
    417430    const std::string QuestManager::getId(QuestHint* item) const
    418431    {
     432        OrxAssert(item, "The input QuestHint is NULL.");
    419433        return item->getId();
    420434    }
Note: See TracChangeset for help on using the changeset viewer.