Fixed battle ending after any faint.
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
@@ -47,18 +47,28 @@ namespace CreatureLib::Battling {
|
||||
|
||||
void GetActiveScripts(std::vector<ScriptWrapper>& scripts) final;
|
||||
|
||||
void MarkSlotAsUnfillable(Creature* creature){
|
||||
for (uint8_t i = 0; i < _creaturesPerSide; i++){
|
||||
if (_creatures[i] == creature){
|
||||
uint8_t GetSideIndex() { return _index; }
|
||||
uint8_t GetCreatureIndex(Creature* c) {
|
||||
for (size_t i = 0; i < _creatures.size(); i++) {
|
||||
if (c == _creatures[i])
|
||||
return i;
|
||||
}
|
||||
throw CreatureException("Unable to find creature on field.");
|
||||
}
|
||||
|
||||
void MarkSlotAsUnfillable(Creature* creature) {
|
||||
for (uint8_t i = 0; i < _creaturesPerSide; i++) {
|
||||
if (_creatures[i] == creature) {
|
||||
_fillableSlots[i] = false;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool IsDefeated(){
|
||||
for (auto b: _fillableSlots){
|
||||
if (b) return false;
|
||||
bool IsDefeated() {
|
||||
for (auto b : _fillableSlots) {
|
||||
if (b)
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user