1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-15 00:05:02 +02:00

Bypass initial version of spell callback

This commit is contained in:
nordsoft
2023-04-10 04:34:24 +04:00
parent fc310c6e79
commit e440343921
7 changed files with 33 additions and 1 deletions

View File

@ -17,6 +17,8 @@
#include "../IGameCallback.h"
#include "../CGameState.h"
#include "../CPlayerState.h"
#include "../spells/CSpellHandler.h"
#include "../spells/ISpellMechanics.h"
#include "CObjectClassesHandler.h"
@ -359,6 +361,14 @@ void CRewardableObject::grantRewardAfterLevelup(const CRewardVisitInfo & info, c
cb->giveCreatures(this, hero, creatures, false);
}
if(!info.reward.casts.empty())
{
for(const auto & c : info.reward.casts)
{
cb->castSpell(hero, c, int3{-1, -1, -1});
}
}
if(info.reward.removeObject)
cb->removeObject(this);