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:
gfgtdf 2020-08-10 16:10:22 +02:00 committed by Charles Dang
parent e9f62bcd66
commit 7e353095c1

View file

@ -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)