1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

fix condition

This commit is contained in:
Laserlicht
2024-09-30 02:46:45 +02:00
parent 713fcd6543
commit e2b49bbf79
2 changed files with 2 additions and 2 deletions

View File

@@ -2261,7 +2261,7 @@ bool CGameHandler::spellResearch(ObjectInstanceID tid, SpellID spellAtSlot, bool
auto spells = t->spells.at(level);
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!"))
return false;