1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-02-03 13:01:33 +02:00
This commit is contained in:
Michał W. Urbańczyk 2012-05-22 21:08:16 +00:00
parent 3e4d0e73e8
commit ee6e9fcc7f
3 changed files with 7 additions and 4 deletions

View File

@ -732,7 +732,7 @@ static void listenForEvents()
break;
case RESTART_GAME:
{
StartInfo si = *client->getStartInfo();
StartInfo si = *client->getStartInfo(true);
endGame();
startGame(&si);
}

View File

@ -712,10 +712,13 @@ void CGameInfoCallback::getUpgradeInfo(const CArmedInstance *obj, int stackPos,
//return gs->getUpgradeInfo(obj->getStack(stackPos));
}
const StartInfo * CGameInfoCallback::getStartInfo() const
const StartInfo * CGameInfoCallback::getStartInfo(bool beforeRandomization /*= false*/) const
{
//boost::shared_lock<boost::shared_mutex> lock(*gs->mx);
return gs->scenarioOps;
if(beforeRandomization)
return gs->initialOpts;
else
return gs->scenarioOps;
}
int CGameInfoCallback::getSpellCost(const CSpell * sp, const CGHeroInstance * caster) const

View File

@ -155,7 +155,7 @@ protected:
public:
//various
int getDate(int mode=0)const; //mode=0 - total days in game, mode=1 - day of week, mode=2 - current week, mode=3 - current month
const StartInfo * getStartInfo()const;
const StartInfo * getStartInfo(bool beforeRandomization = false)const;
bool isAllowed(int type, int id); //type: 0 - spell; 1- artifact; 2 - secondary skill
//player