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 GitHub
parent 4b5c7c291b
commit 2618583a28
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -83,7 +83,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)