mirror of
https://github.com/vcmi/vcmi.git
synced 2025-08-13 19:54:17 +02:00
Merge pull request #162 from vmarkovtsev/issue/2377
Fix 2377 "Seer Empty Text"
This commit is contained in:
@@ -27,7 +27,7 @@
|
|||||||
#include "mapping/CCampaignHandler.h" //for CCampaignState
|
#include "mapping/CCampaignHandler.h" //for CCampaignState
|
||||||
#include "rmg/CMapGenerator.h" // for CMapGenOptions
|
#include "rmg/CMapGenerator.h" // for CMapGenOptions
|
||||||
|
|
||||||
const ui32 version = 756;
|
const ui32 version = 757;
|
||||||
const ui32 minSupportedVersion = 753;
|
const ui32 minSupportedVersion = 753;
|
||||||
|
|
||||||
class CISer;
|
class CISer;
|
||||||
|
@@ -416,6 +416,7 @@ void CGSeerHut::init()
|
|||||||
{
|
{
|
||||||
seerName = *RandomGeneratorUtil::nextItem(VLC->generaltexth->seerNames, cb->gameState()->getRandomGenerator());
|
seerName = *RandomGeneratorUtil::nextItem(VLC->generaltexth->seerNames, cb->gameState()->getRandomGenerator());
|
||||||
quest->textOption = cb->gameState()->getRandomGenerator().nextInt(2);
|
quest->textOption = cb->gameState()->getRandomGenerator().nextInt(2);
|
||||||
|
quest->completedOption = cb->gameState()->getRandomGenerator().nextInt(1, 5);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGSeerHut::initObj()
|
void CGSeerHut::initObj()
|
||||||
@@ -435,7 +436,7 @@ void CGSeerHut::initObj()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
quest->progress = CQuest::COMPLETE;
|
quest->progress = CQuest::COMPLETE;
|
||||||
quest->firstVisitText = VLC->generaltexth->seerEmpty[quest->textOption];
|
quest->firstVisitText = VLC->generaltexth->seerEmpty[quest->completedOption];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -582,7 +583,7 @@ void CGSeerHut::onHeroVisit( const CGHeroInstance * h ) const
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
iw.text << VLC->generaltexth->seerEmpty[quest->textOption];
|
iw.text << VLC->generaltexth->seerEmpty[quest->completedOption];
|
||||||
if (ID == Obj::SEER_HUT)
|
if (ID == Obj::SEER_HUT)
|
||||||
iw.text.addReplacement(seerName);
|
iw.text.addReplacement(seerName);
|
||||||
cb->showInfoDialog(&iw);
|
cb->showInfoDialog(&iw);
|
||||||
|
@@ -37,8 +37,11 @@ public:
|
|||||||
std::vector<CStackBasicDescriptor> m6creatures; //pair[cre id, cre count], CreatureSet info irrelevant
|
std::vector<CStackBasicDescriptor> m6creatures; //pair[cre id, cre count], CreatureSet info irrelevant
|
||||||
std::vector<ui32> m7resources; //TODO: use resourceset?
|
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 textOption;
|
||||||
|
ui8 completedOption;
|
||||||
CStackBasicDescriptor stackToKill;
|
CStackBasicDescriptor stackToKill;
|
||||||
ui8 stackDirection;
|
ui8 stackDirection;
|
||||||
std::string heroName; //backup of hero name
|
std::string heroName; //backup of hero name
|
||||||
@@ -66,7 +69,16 @@ public:
|
|||||||
{
|
{
|
||||||
h & qid & missionType & progress & lastDay & m13489val & m2stats & m5arts & m6creatures & m7resources
|
h & qid & missionType & progress & lastDay & m13489val & m2stats & m5arts & m6creatures & m7resources
|
||||||
& textOption & stackToKill & stackDirection & heroName & heroPortrait
|
& textOption & stackToKill & stackDirection & heroName & heroPortrait
|
||||||
& firstVisitText & nextVisitText & completedText & isCustomFirst & isCustomNext & isCustomComplete;
|
& firstVisitText & nextVisitText & completedText & isCustomFirst
|
||||||
|
& isCustomNext & isCustomComplete;
|
||||||
|
if(version >= 757)
|
||||||
|
{
|
||||||
|
h & completedOption;
|
||||||
|
}
|
||||||
|
else if(!h.saving)
|
||||||
|
{
|
||||||
|
completedOption = 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user