mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
Workaround to avoid crash on invalid bonus
This commit is contained in:
parent
ee7bd87b8d
commit
a7c838036d
@ -1088,7 +1088,10 @@ void BattleActionProcessor::attackCasting(const CBattleInfoCallback & battle, bo
|
||||
TConstBonusListPtr spells = attacker->getBonuses(Selector::type()(attackMode));
|
||||
for(const auto & sf : *spells)
|
||||
{
|
||||
spellsToCast.insert(sf->subtype.as<SpellID>());
|
||||
if (sf->subtype.as<SpellID>() != SpellID())
|
||||
spellsToCast.insert(sf->subtype.as<SpellID>());
|
||||
else
|
||||
logMod->error("Invalid spell to cast during attack!");
|
||||
}
|
||||
for(SpellID spellID : spellsToCast)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user