mirror of
https://github.com/vcmi/vcmi.git
synced 2025-07-17 01:32:21 +02:00
Fix commander appearing in battles while dead
This commit is contained in:
@ -499,7 +499,7 @@ BattleInfo * BattleInfo::setupBattle( int3 tile, ETerrainType terrain, BFieldTyp
|
|||||||
//adding commanders
|
//adding commanders
|
||||||
for (int i = 0; i < 2; ++i)
|
for (int i = 0; i < 2; ++i)
|
||||||
{
|
{
|
||||||
if (heroes[i] && heroes[i]->commander)
|
if (heroes[i] && heroes[i]->commander && heroes[i]->commander->alive)
|
||||||
{
|
{
|
||||||
CStack * stack = curB->generateNewStack (*heroes[i]->commander, !i, SlotID::COMMANDER_SLOT_PLACEHOLDER,
|
CStack * stack = curB->generateNewStack (*heroes[i]->commander, !i, SlotID::COMMANDER_SLOT_PLACEHOLDER,
|
||||||
creatureBank ? commanderBank[i] : commanderField[i]);
|
creatureBank ? commanderBank[i] : commanderField[i]);
|
||||||
|
@ -102,7 +102,7 @@ public:
|
|||||||
//TODO: what if Commander is not a part of creature set?
|
//TODO: what if Commander is not a part of creature set?
|
||||||
|
|
||||||
//commander class is determined by its base creature
|
//commander class is determined by its base creature
|
||||||
ui8 alive;
|
bool alive;
|
||||||
ui8 level; //required only to count callbacks
|
ui8 level; //required only to count callbacks
|
||||||
std::string name; // each Commander has different name
|
std::string name; // each Commander has different name
|
||||||
std::vector <ui8> secondarySkills; //ID -> level
|
std::vector <ui8> secondarySkills; //ID -> level
|
||||||
|
Reference in New Issue
Block a user