diff options
author | Benji Dial <benji6283@gmail.com> | 2023-11-26 20:28:29 -0500 |
---|---|---|
committer | Benji Dial <benji6283@gmail.com> | 2023-11-26 20:28:29 -0500 |
commit | 8723fe078180916a6b2f736232e7f5bec2b9674e (patch) | |
tree | 474ae9a0cc40a6cbb146fee224544bbe031f76a6 /bench | |
parent | 920bedec8c2bec3dc9e938a88fc2fe3fb7e49fe1 (diff) | |
download | lib94-8723fe078180916a6b2f736232e7f5bec2b9674e.tar.gz |
add function to lib94 to remove all warriors; fix crash on removing last warrior in bench
Diffstat (limited to 'bench')
-rw-r--r-- | bench/bench_window.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/bench/bench_window.cpp b/bench/bench_window.cpp index 08f2236..39992eb 100644 --- a/bench/bench_window.cpp +++ b/bench/bench_window.cpp @@ -320,7 +320,17 @@ void bench_window::on_click_remove_warrior() { break; } - on_click_new_round(); + if (warriors.size()) + on_click_new_round(); + + else { + lib94::remove_all_warriors(); + lib94::clear_address_sets(); + core.mut.lock(); + core.clear_all(); + core.mut.unlock(); + update_ui(); + } delete w; |