mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-12 02:28:11 +02:00
fix condition
This commit is contained in:
parent
713fcd6543
commit
e2b49bbf79
@ -2042,7 +2042,7 @@ void CMageGuildScreen::Scroll::clickPressed(const Point & cursorPosition)
|
|||||||
level = i;
|
level = i;
|
||||||
|
|
||||||
int today = LOCPLINT->cb->getDate(Date::DAY);
|
int today = LOCPLINT->cb->getDate(Date::DAY);
|
||||||
if(town->spellResearchActionsPerDay.find(today) == town->spellResearchActionsPerDay.end() || town->spellResearchActionsPerDay.at(today) >= LOCPLINT->cb->getSettings().getValue(EGameSettings::TOWNS_SPELL_RESEARCH_PER_DAY).Vector()[level].Float())
|
if(town->spellResearchActionsPerDay.find(today) != town->spellResearchActionsPerDay.end() && town->spellResearchActionsPerDay.at(today) >= LOCPLINT->cb->getSettings().getValue(EGameSettings::TOWNS_SPELL_RESEARCH_PER_DAY).Vector()[level].Float())
|
||||||
{
|
{
|
||||||
LOCPLINT->showInfoDialog(CGI->generaltexth->translate("vcmi.spellResearch.comeAgain"));
|
LOCPLINT->showInfoDialog(CGI->generaltexth->translate("vcmi.spellResearch.comeAgain"));
|
||||||
return;
|
return;
|
||||||
|
@ -2261,7 +2261,7 @@ bool CGameHandler::spellResearch(ObjectInstanceID tid, SpellID spellAtSlot, bool
|
|||||||
auto spells = t->spells.at(level);
|
auto spells = t->spells.at(level);
|
||||||
|
|
||||||
int today = getDate(Date::DAY);
|
int today = getDate(Date::DAY);
|
||||||
bool researchLimitExceeded = t->spellResearchActionsPerDay.find(today) == t->spellResearchActionsPerDay.end() || t->spellResearchActionsPerDay.at(today) >= getSettings().getValue(EGameSettings::TOWNS_SPELL_RESEARCH_PER_DAY).Vector()[level].Float();
|
bool researchLimitExceeded = t->spellResearchActionsPerDay.find(today) != t->spellResearchActionsPerDay.end() && t->spellResearchActionsPerDay.at(today) >= getSettings().getValue(EGameSettings::TOWNS_SPELL_RESEARCH_PER_DAY).Vector()[level].Float();
|
||||||
if(researchLimitExceeded && complain("Already researched today!"))
|
if(researchLimitExceeded && complain("Already researched today!"))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user