Skip to content

Commit

Permalink
Fix 2377 "Seer Empty Text"
Browse files Browse the repository at this point in the history
  • Loading branch information
vmarkovtsev committed Jan 21, 2016
1 parent e4b7318 commit f0b0d58
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
5 changes: 3 additions & 2 deletions lib/mapObjects/CQuest.cpp
Expand Up @@ -416,6 +416,7 @@ void CGSeerHut::init()
{
seerName = *RandomGeneratorUtil::nextItem(VLC->generaltexth->seerNames, cb->gameState()->getRandomGenerator());
quest->textOption = cb->gameState()->getRandomGenerator().nextInt(2);
quest->completedOption = cb->gameState()->getRandomGenerator().nextInt(1, 5);
}

void CGSeerHut::initObj()
Expand All @@ -435,7 +436,7 @@ void CGSeerHut::initObj()
else
{
quest->progress = CQuest::COMPLETE;
quest->firstVisitText = VLC->generaltexth->seerEmpty[quest->textOption];
quest->firstVisitText = VLC->generaltexth->seerEmpty[quest->completedOption];
}
}

Expand Down Expand Up @@ -582,7 +583,7 @@ void CGSeerHut::onHeroVisit( const CGHeroInstance * h ) const
}
else
{
iw.text << VLC->generaltexth->seerEmpty[quest->textOption];
iw.text << VLC->generaltexth->seerEmpty[quest->completedOption];
if (ID == Obj::SEER_HUT)
iw.text.addReplacement(seerName);
cb->showInfoDialog(&iw);
Expand Down
7 changes: 5 additions & 2 deletions lib/mapObjects/CQuest.h
Expand Up @@ -37,8 +37,11 @@ class DLL_LINKAGE CQuest
std::vector<CStackBasicDescriptor> m6creatures; //pair[cre id, cre count], CreatureSet info irrelevant
std::vector<ui32> m7resources; //TODO: use resourceset?

//following field are used only for kill creature/hero missions, the original objects became inaccessible after their removal, so we need to store info needed for messages / hover text
// following fields are used only for kill creature/hero missions, the original
// objects became inaccessible after their removal, so we need to store info
// needed for messages / hover text
ui8 textOption;
ui8 completedOption;
CStackBasicDescriptor stackToKill;
ui8 stackDirection;
std::string heroName; //backup of hero name
Expand All @@ -65,7 +68,7 @@ class DLL_LINKAGE CQuest
template <typename Handler> void serialize(Handler &h, const int version)
{
h & qid & missionType & progress & lastDay & m13489val & m2stats & m5arts & m6creatures & m7resources
& textOption & stackToKill & stackDirection & heroName & heroPortrait
& textOption & completedOption & stackToKill & stackDirection & heroName & heroPortrait
& firstVisitText & nextVisitText & completedText & isCustomFirst & isCustomNext & isCustomComplete;
}
};
Expand Down

0 comments on commit f0b0d58

Please sign in to comment.