Changeset 11071 for code/trunk/src/modules/questsystem/QuestListener.cc
- Timestamp:
- Jan 17, 2016, 10:29:21 PM (8 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
-
code/trunk/src/modules/questsystem/QuestListener.cc
r9667 r11071 59 59 60 60 this->mode_ = QuestListenerMode::All; 61 this->quest_ = NULL;61 this->quest_ = nullptr; 62 62 } 63 63 … … 81 81 XMLPortParam(QuestListener, "mode", setMode, getMode, xmlelement, mode); 82 82 83 if(this->quest_ != NULL)83 if(this->quest_ != nullptr) 84 84 this->quest_->addListener(this); // Adds the QuestListener to the Quests list of listeners. 85 85 … … 97 97 /* static */ void QuestListener::advertiseStatusChange(std::list<QuestListener*> & listeners, const std::string & status) 98 98 { 99 for (std::list<QuestListener*>::iterator it = listeners.begin(); it != listeners.end(); ++it) // Iterate through all QuestListeners 100 { 101 QuestListener* listener = *it; 99 for (QuestListener* listener : listeners) // Iterate through all QuestListeners 100 { 102 101 if(listener->getMode() == status || listener->getMode() == QuestListener::ALL) // Check whether the status change affects the give QuestListener. 103 102 listener->execute(); … … 117 116 this->quest_ = QuestManager::getInstance().findQuest(id); // Find the Quest corresponding to the given questId. 118 117 119 if(this->quest_ == NULL) // If there is no such Quest.118 if(this->quest_ == nullptr) // If there is no such Quest. 120 119 { 121 120 ThrowException(Argument, "This is bad! The QuestListener has not found a Quest with a corresponding id..");
Note: See TracChangeset
for help on using the changeset viewer.