Adds creature Switch event.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2020-08-07 10:38:35 +02:00
parent 9d56aaa52a
commit 3a170d8924
3 changed files with 16 additions and 3 deletions

View File

@@ -62,13 +62,14 @@ void BattleSide::SetCreature(ArbUt::BorrowedPtr<Creature> creature, uint8_t inde
for (auto side : _battle->GetSides()) {
if (side == this)
continue;
for (auto c : side->GetCreatures()) {
for (const auto& c : side->GetCreatures()) {
if (c != nullptr) {
c->MarkOpponentAsSeen(creature);
creature->MarkOpponentAsSeen(c.GetRaw());
}
}
}
_battle->TriggerEventListener<SwitchEvent>(CreatureIndex(this->_index, index), creature);
}
bool BattleSide::CreatureOnSide(const ArbUt::BorrowedPtr<Creature>& creature) const {