فهرست منبع

* one more fix for r1145

mateuszb 16 سال پیش
والد
کامیت
543e3c6431
3فایلهای تغییر یافته به همراه5 افزوده شده و 7 حذف شده
  1. 1 1
      hch/CObjectHandler.cpp
  2. 3 5
      lib/IGameCallback.cpp
  3. 1 1
      lib/IGameCallback.h

+ 1 - 1
hch/CObjectHandler.cpp

@@ -1286,7 +1286,7 @@ int CGTownInstance::getSightRadious() const //returns sight distance
 	if (subID == 2) //tower
 	{
 		if ((builtBuildings.find(17)) != builtBuildings.end()) //skyship
-			return cb->getMapSize().first + cb->getMapSize().second;
+			return cb->getMapSize().x + cb->getMapSize().y;
 		else if ((builtBuildings.find(21)) != builtBuildings.end()) //lookout tower
 			return 20;
 	}

+ 3 - 5
lib/IGameCallback.cpp

@@ -190,13 +190,11 @@ void IGameCallback::getAllowed(std::vector<CArtifact*> &out, int flags)
 		getAllowedArts(out,&CArtHandler::relics);
 }
 
-std::pair<ui16, ui16> IGameCallback::getMapSize()
+int3 IGameCallback::getMapSize()
 {
-	std::pair<ui16, ui16> dimensions;
-	dimensions.first = gs->map->width;
-	dimensions.second = gs->map->height;
-	return dimensions;
+	return int3(gs->map->width, gs->map->height, gs->map->twoLevel + 1);
 }
+
 inline TerrainTile * IGameCallback::getTile( int3 pos )
 {
 	if(!gs->map->isInTheMap(pos))

+ 1 - 1
lib/IGameCallback.h

@@ -58,7 +58,7 @@ public:
 	virtual bool isAllowed(int type, int id); //type: 0 - spell; 1- artifact
 	virtual void getAllowedArts(std::vector<CArtifact*> &out, std::vector<CArtifact*> CArtHandler::*arts);
 	virtual void getAllowed(std::vector<CArtifact*> &out, int flags); //flags: bitfield uses EartClass
-	virtual std::pair<ui16, ui16> getMapSize();
+	virtual int3 getMapSize(); //returns size of the map
 	virtual TerrainTile * getTile(int3 pos);
 
 	//do sth