Kaynağa Gözat

* fixed crashbug with dissmising heroes
* fixed bug with hero list redrawing after dissmissing

Pioxan 17 yıl önce
ebeveyn
işleme
1b55f6457f
2 değiştirilmiş dosya ile 4 ekleme ve 1 silme
  1. 3 1
      CAdvmapInterface.cpp
  2. 1 0
      CPlayerInterface.cpp

+ 3 - 1
CAdvmapInterface.cpp

@@ -302,7 +302,9 @@ void CTerrainRect::clickLeft(tribool down)
 			currentPath=NULL;
 		}
 	}
-	const CGHeroInstance * currentHero = LOCPLINT->adventureInt->heroList.items[LOCPLINT->adventureInt->heroList.selected].first;
+	const CGHeroInstance * currentHero = (LOCPLINT->adventureInt->heroList.items.size())?(LOCPLINT->adventureInt->heroList.items[LOCPLINT->adventureInt->heroList.selected].first):(NULL);
+	if(!currentHero)
+		return; 
 	int3 bufpos = currentHero->getPosition(false);
 	//bufpos.x-=1;
 	if (mres)

+ 1 - 0
CPlayerInterface.cpp

@@ -2200,6 +2200,7 @@ void CHeroList::updateHList()
 	genList();
 	if(selected>=items.size())
 		select(items.size()-1);
+	draw();
 }
 void CHeroList::updateMove(const CGHeroInstance* which) //draws move points bar
 {