Преглед на файлове

Added missionType check to CQuest::getRolloverText

This function shouldn't be called if quest type is MISSION_NONE as this type used for quest that don't have text yet.
For example Keymaster`s border guards in H3 didn't add any entries to Quest Log so there is no text for them or at least it's not defined how to use it in VCMI.
ArseniyShestakov преди 10 години
родител
ревизия
746914d219
променени са 1 файла, в които са добавени 3 реда и са изтрити 0 реда
  1. 3 0
      lib/mapObjects/CQuest.cpp

+ 3 - 0
lib/mapObjects/CQuest.cpp

@@ -223,6 +223,9 @@ void CQuest::getVisitText (MetaString &iwText, std::vector<Component> &component
 
 
 void CQuest::getRolloverText (MetaString &ms, bool onHover) const
 void CQuest::getRolloverText (MetaString &ms, bool onHover) const
 {
 {
+	// Quests with MISSION_NONE type don't have a text for them
+	assert(missionType != MISSION_NONE);
+
 	if (onHover)
 	if (onHover)
 		ms << "\n\n";
 		ms << "\n\n";