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

Merge pull request #1928 from Nordsoft91/cast-reward

Spell cast reward
This commit is contained in:
Nordsoft91
2023-04-10 22:49:36 +04:00
committed by GitHub
20 changed files with 268 additions and 77 deletions

View File

@@ -6299,6 +6299,19 @@ bool CGameHandler::moveStack(const StackLocation &src, const StackLocation &dst,
return true;
}
void CGameHandler::castSpell(const spells::Caster * caster, SpellID spellID, const int3 &pos)
{
const CSpell * s = spellID.toSpell();
if(!s)
return;
AdventureSpellCastParameters p;
p.caster = caster;
p.pos = pos;
s->adventureCast(spellEnv, p);
}
bool CGameHandler::swapStacks(const StackLocation & sl1, const StackLocation & sl2)
{
if(!sl1.army->hasStackAtSlot(sl1.slot))
@@ -7360,4 +7373,4 @@ const ObjectInstanceID CGameHandler::putNewObject(Obj ID, int subID, int3 pos)
no.pos = pos;
sendAndApply(&no);
return no.id; //id field will be filled during applying on gs
}
}