mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-17 00:07:41 +02:00
* support for new creature abilities: hate, spell cost decreasing, spell vulnerability
* fixed crash when vcmiistari is applied on hero without spell book
This commit is contained in:
@ -736,7 +736,16 @@ DLL_EXPORT void SpellCast::applyGs( CGameState *gs )
|
||||
CGHeroInstance *h = (side) ? gs->getHero(gs->curB->hero2) : gs->getHero(gs->curB->hero1);
|
||||
if(h)
|
||||
{
|
||||
h->mana -= VLC->spellh->spells[id].costs[skill];
|
||||
int spellCost = 0;
|
||||
if(gs->curB)
|
||||
{
|
||||
spellCost = gs->curB->getSpellCost(&VLC->spellh->spells[id], h);
|
||||
}
|
||||
else
|
||||
{
|
||||
spellCost = VLC->spellh->spells[id].costs[skill];
|
||||
}
|
||||
h->mana -= spellCost;
|
||||
if(h->mana < 0) h->mana = 0;
|
||||
}
|
||||
if(side >= 0 && side < 2)
|
||||
|
Reference in New Issue
Block a user