1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-02-05 13:04:54 +02:00

NetPacks: add BATTLE type to GiveBonus

Will work as battlefield effect of current battle.
This commit is contained in:
Konstantin 2023-03-28 14:57:44 +03:00
parent 5716925b47
commit 89fd742c1a
2 changed files with 5 additions and 1 deletions

View File

@ -349,7 +349,7 @@ struct DLL_LINKAGE SetAvailableHeroes : public CPackForClient
struct DLL_LINKAGE GiveBonus : public CPackForClient
{
enum class ETarget : ui8 { HERO, PLAYER, TOWN };
enum class ETarget : ui8 { HERO, PLAYER, TOWN, BATTLE };
GiveBonus(ETarget Who = ETarget::HERO)
:who(Who)

View File

@ -961,6 +961,10 @@ void GiveBonus::applyGs(CGameState *gs)
case ETarget::TOWN:
cbsn = gs->getTown(ObjectInstanceID(id));
break;
case ETarget::BATTLE:
assert(Bonus::OneBattle(&bonus));
cbsn = dynamic_cast<CBonusSystemNode*>(gs->curB.get());
break;
}
assert(cbsn);