Implements marking opponents as seen.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -38,12 +38,24 @@ void BattleSide::SetChoice(BaseTurnChoice* choice) {
|
||||
|
||||
void BattleSide::SetCreature(Creature* creature, uint8_t index) {
|
||||
auto old = _creatures[index];
|
||||
if (old != nullptr){
|
||||
if (old != nullptr) {
|
||||
old->SetOnBattleField(false);
|
||||
}
|
||||
_creatures[index] = creature;
|
||||
creature->SetBattleData(_battle, this);
|
||||
creature->SetOnBattleField(true);
|
||||
if (_battle == nullptr)
|
||||
return;
|
||||
for (auto side : _battle->GetSides()) {
|
||||
if (side == this)
|
||||
continue;
|
||||
for (auto c : side->GetCreatures()) {
|
||||
if (c != nullptr) {
|
||||
c->MarkOpponentAsSeen(creature);
|
||||
creature->MarkOpponentAsSeen(c);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool BattleSide::CreatureOnSide(const Creature* creature) const {
|
||||
|
||||
Reference in New Issue
Block a user