| 86 | } |
| 87 | |
| 88 | bool RemoveAllBattle(StateVec& states, const PermanentStates& ps) { |
| 89 | bool any_removed = false; |
| 90 | for (int i = 0; i < (int)states.size(); ++i) { |
| 91 | auto state_id = i + 1; |
| 92 | auto* state = lcf::ReaderUtil::GetElement(lcf::Data::states, state_id); |
| 93 | if (state == nullptr) { |
| 94 | Output::Warning("State::RemoveAllBattle: Can't remove state with invalid ID {}", state_id); |
| 95 | continue; |
| 96 | } |
| 97 | if (state->type == lcf::rpg::State::Persistence_persists) { |
| 98 | if (state->auto_release_prob == 0 || ps.Has(state_id)) { |
| 99 | continue; |
| 100 | } |
| 101 | } |
| 102 | any_removed |= Remove(state_id, states, {}); |
| 103 | } |
| 104 | return any_removed; |
| 105 | } |
| 106 | |
| 107 | bool RemoveAll(StateVec& states, const PermanentStates& ps) { |
| 108 | bool any_removed = false; |
no test coverage detected