Fix WML commands replacing regular menuitems

This commit is contained in:
Celtic Minstrel 2017-04-28 15:43:52 -04:00
parent 19fa4244af
commit c77800333c

View file

@ -413,7 +413,6 @@ void play_controller::hotkey_handler::expand_autosaves(std::vector<config>& item
void play_controller::hotkey_handler::expand_wml_commands(std::vector<config>& items, int i)
{
wml_commands_.clear();
// Pad the commands with null pointers (keeps the indices of items and wml_commands_ synced).
wml_commands_.resize(i);
@ -446,6 +445,7 @@ void play_controller::hotkey_handler::show_menu(const std::vector<config>& items
// Add special non-hotkey items to the menu and remember their indices
// Iterate in reverse to avoid also iterating over the new inserted items
wml_commands_.clear();
for(int i = items.size() - 1; i >= 0; i--) {
if(items[i]["id"] == "AUTOSAVES") {
expand_autosaves(items, i);