Michał W. Urbańczyk 15 năm trước cách đây
mục cha
commit
42fade07dc
3 tập tin đã thay đổi với 11 bổ sung1 xóa
  1. 5 0
      client/CAdvmapInterface.cpp
  2. 5 0
      lib/CGameState.cpp
  3. 1 1
      lib/map.cpp

+ 5 - 0
client/CAdvmapInterface.cpp

@@ -535,6 +535,11 @@ void CTerrainRect::clickLeft(tribool down, bool previousState)
 				}
 			}
 		}
+		else if(currentHero == vobjs.back()) //selected hero is standing at the town entrance
+		{
+			LOCPLINT->openHeroWindow(currentHero);
+			return;
+		}
 
 		//still here? we need to move hero if we clicked end of already selected path or calculate a new path otherwise
 		if (currentPath  &&  currentPath->endPos() == mp)//we'll be moving

+ 5 - 0
lib/CGameState.cpp

@@ -1444,6 +1444,11 @@ void CGameState::init(StartInfo * si, Mapa * map, int Seed)
 		players.find(vhi->getOwner())->second.heroes.push_back(vhi);
 		hids.erase(vhi->subID);
 	}
+	for (unsigned int i=0; i<map->objects.size();i++) //heroes instances initialization
+	{
+		if (map->objects[i]->ID == 62)
+			hids.erase(map->objects[i]->subID);
+	}
 	for(unsigned int i=0; i<map->predefinedHeroes.size(); i++)
 	{
 		if(!vstd::contains(hids,map->predefinedHeroes[i]->subID))

+ 1 - 1
lib/map.cpp

@@ -1933,7 +1933,7 @@ void Mapa::readObjects( const unsigned char * bufor, int &i)
 		nobj->pos = pos;
 		nobj->ID = defInfo->id;
 		nobj->id = objects.size();
-		if(nobj->ID != HEROI_TYPE && nobj->ID != 214)
+		if(nobj->ID != HEROI_TYPE && nobj->ID != 214 && nobj->ID != 62)
 			nobj->subID = defInfo->subid;
 		nobj->defInfo = defInfo;
 		objects.push_back(nobj);