Forráskód Böngészése

*fixed bugs with hero dismissing

Michał W. Urbańczyk 18 éve
szülő
commit
6cb9ed9f8b
3 módosított fájl, 9 hozzáadás és 21 törlés
  1. 2 2
      CMT.cpp
  2. 5 2
      CPlayerInterface.cpp
  3. 2 17
      hch/CBuildingHandler.h

+ 2 - 2
CMT.cpp

@@ -310,6 +310,7 @@ int _tmain(int argc, _TCHAR* argv[])
 		//cb.open("CSECRET.BIK");
 	THC timeHandler tmh;
 	THC tmh.getDif();
+	timeHandler pomtime;pomtime.getDif();
 	int xx=0, yy=0, zz=0;
 	SDL_Event sEvent;
 	srand ( time(NULL) );
@@ -366,7 +367,7 @@ int _tmain(int argc, _TCHAR* argv[])
 		#endif
 		cgi->consoleh = new CConsoleHandler;
 		cgi->mush = mush;
-		cgi->curh = new CCursorHandler;
+		cgi->curh = new CCursorHandler; 
 		
 		THC std::cout<<"Initializing screen, fonts and sound handling: "<<tmh.getDif()<<std::endl;
 		cgi->spriteh = new CLodHandler;
@@ -767,7 +768,6 @@ int _tmain(int argc, _TCHAR* argv[])
 		cgi->scenarioOps = cpg->runLoop();
 		THC tmh.getDif();
 
-		timeHandler pomtime;pomtime.getDif();
 		CArtHandler * arth = new CArtHandler;
 		arth->loadArtifacts();
 		cgi->arth = arth;

+ 5 - 2
CPlayerInterface.cpp

@@ -2200,7 +2200,10 @@ void CHeroList::updateHList()
 	genList();
 	if(selected>=items.size())
 		select(items.size()-1);
-	draw();
+	if(items.size()==0)
+		LOCPLINT->adventureInt->townList.select(0);
+	else
+		select(selected);
 }
 void CHeroList::updateMove(const CGHeroInstance* which) //draws move points bar
 {
@@ -2246,4 +2249,4 @@ void CHeroList::draw()
 		blitAt(arrdo->ourImages[0].bitmap,arrdop.x,arrdop.y);
 	else
 		blitAt(arrdo->ourImages[2].bitmap,arrdop.x,arrdop.y);
-}
+}

+ 2 - 17
hch/CBuildingHandler.h

@@ -1,8 +1,6 @@
 #ifndef CBUILDINGHANDLER_H
 #define CBUILDINGHANDLER_H
-
-#include <vector>
-#include <string>
+#include "../global.h"
 
 enum EbuildingType {NEUTRAL=0, CASTLE, RAMPART, TOWER, INFERNO, NECROPOLIS, DUNGEON, STRONGHOLD, FORTRESS, CONFLUX};
 
@@ -17,23 +15,10 @@ public:
 	bool isDwelling; //true, if this building is a dwelling
 };
 
-//class CGBuilding
-//{
-//	int ID, subID;
-//
-//	struct {
-//		int x, y;
-//	} pos;
-//
-//	bool allowed;
-//	bool built;
-//
-//	std::string name, description
-//};
-
 class CBuildingHandler
 {
 public:
+	//std::map<int, std::map<int, CBuilding*> > buildings; ///< first int is the castle ID, second the building ID (in ERM-U format)
 	std::vector<CBuilding> buildings; //vector of buildings
 	std::vector<CBuilding> resourceSilos; //vector with resource silos only - for castle profiled descriptions
 	std::vector<CBuilding> grails; //vector with grail - type buildings only - for castle profiled descriptions