mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-18 17:03:25 +00:00
fix crash in mp lobby
Fixes #4792 Previously that line would call generator::set_item_shown which inherits that class since set_item_shown is virtual. This doesn't work, in particular since generator::set_item_shown wouldn't do anything if the to-be-deleted selected item is already hidden. (which for some reason happens quite often in the mp lobby window). This resulted in generator::delete_item deleting a selecting item, so selected_item_count_ would become wrong.
This commit is contained in:
parent
e9f62bcd66
commit
7e353095c1
@ -84,7 +84,7 @@ bool one_item::deselect_item(const unsigned index)
|
||||
void one_item::delete_item(const unsigned index)
|
||||
{
|
||||
// this needs the same logic for ensuring that at least one item is selected
|
||||
set_item_shown(index, false);
|
||||
one_item::set_item_shown(index, false);
|
||||
}
|
||||
|
||||
void no_item::set_item_shown(const unsigned index, const bool show)
|
||||
|
Loading…
x
Reference in New Issue
Block a user