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

spell replacement works

This commit is contained in:
Laserlicht
2024-09-27 23:52:33 +02:00
parent a9327b3fa3
commit 857b2e9a35
6 changed files with 37 additions and 19 deletions

View File

@@ -2248,21 +2248,17 @@ bool CGameHandler::spellResearch(ObjectInstanceID tid)
return false;
CGTownInstance *t = gs->getTown(tid);
auto spells = t->spells.at(1);
auto spells = t->spells.at(0);
auto spell = SpellID(SpellID::FLY);
spells.at(0) = spell;
setTownSpells(t, 1, spells);
spellResearchFinished(tid);
return true;
}
setTownSpells(t, 0, spells);
void CGameHandler::spellResearchFinished(ObjectInstanceID tid)
{
const CGTownInstance * t = getTown(tid);
if(t->visitingHero)
giveSpells(t, t->visitingHero);
if(t->garrisonHero)
giveSpells(t, t->garrisonHero);
return true;
}
bool CGameHandler::recruitCreatures(ObjectInstanceID objid, ObjectInstanceID dstid, CreatureID crid, ui32 cram, si32 fromLvl, PlayerColor player)