mirror of
https://github.com/vcmi/vcmi.git
synced 2025-07-13 01:20:34 +02:00
Workaround to avoid crash on invalid bonus
This commit is contained in:
@ -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)
|
||||
{
|
||||
|
Reference in New Issue
Block a user