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

Changed checks for null with checks for hasValue

This commit is contained in:
Ivan Savenko
2024-01-20 16:41:10 +02:00
parent 31b04780c9
commit 24d25730ad
6 changed files with 19 additions and 17 deletions

View File

@@ -3955,14 +3955,14 @@ bool CGameHandler::moveStack(const StackLocation &src, const StackLocation &dst,
void CGameHandler::castSpell(const spells::Caster * caster, SpellID spellID, const int3 &pos)
{
const CSpell * s = spellID.toSpell();
if(!s)
if (!spellID.hasValue())
return;
AdventureSpellCastParameters p;
p.caster = caster;
p.pos = pos;
const CSpell * s = spellID.toSpell();
s->adventureCast(spellEnv, p);
}