| 61 | } |
| 62 | |
| 63 | bool Remove(int state_id, StateVec& states, const PermanentStates& ps) { |
| 64 | const lcf::rpg::State* state = lcf::ReaderUtil::GetElement(lcf::Data::states, state_id); |
| 65 | if (!state) { |
| 66 | Output::Warning("State::Remove: Can't remove state with invalid ID {}", state_id); |
| 67 | return false; |
| 68 | } |
| 69 | |
| 70 | if (state_id - 1 >= static_cast<int>(states.size())) { |
| 71 | return false; |
| 72 | } |
| 73 | |
| 74 | auto& st = states[state_id - 1]; |
| 75 | |
| 76 | if (!st) { |
| 77 | return false; |
| 78 | } |
| 79 | |
| 80 | if (ps.Has(state_id)) { |
| 81 | return false; |
| 82 | } |
| 83 | |
| 84 | st = 0; |
| 85 | return true; |
| 86 | } |
| 87 | |
| 88 | bool RemoveAllBattle(StateVec& states, const PermanentStates& ps) { |
| 89 | bool any_removed = false; |
no test coverage detected