Fixed battle ending after any faint.
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2019-12-07 22:52:43 +01:00
parent f5aa168f1b
commit dc9296194e
3 changed files with 51 additions and 8 deletions

View File

@@ -99,8 +99,10 @@ void Battling::Creature::Damage(uint32_t damage, Battling::DamageSource source)
// HOOK: On Damage
__CurrentHealth -= damage;
if (IsFainted()){
_side->MarkSlotAsUnfillable(this);
if (IsFainted() && damage > 0) {
if (!_battle->CanSlotBeFilled(_side->GetSideIndex(), _side->GetCreatureIndex(this))) {
_side->MarkSlotAsUnfillable(this);
}
_battle->ValidateBattleState();
}
}