Browse Source

Fix crash on reordering towns from town interface

Ivan Savenko 11 months ago
parent
commit
69ee1a9098
1 changed files with 5 additions and 2 deletions
  1. 5 2
      client/adventureMap/CList.cpp

+ 5 - 2
client/adventureMap/CList.cpp

@@ -471,8 +471,11 @@ void CTownList::CTownItem::gesture(bool on, const Point & initialPosition, const
 	int townLowerPos = (townIndex > towns.size() - 2) ? -1 : townIndex + 1;
 
 	auto updateList = [](){
-		for (auto ki : GH.windows().findWindows<CCastleInterface>())
-			ki->townChange(); //update list
+		for (auto ci : GH.windows().findWindows<CCastleInterface>())
+		{
+			ci->townlist->updateWidget();
+			ci->townlist->select(ci->town);
+		}
 	};
 
 	std::vector<RadialMenuConfig> menuElements = {