Explorar o código

Fixed #331 - Cartographer messages will now be based on their type and not the surface.

DjWarmonger %!s(int64=16) %!d(string=hai) anos
pai
achega
b79fe389a2
Modificáronse 1 ficheiros con 10 adicións e 5 borrados
  1. 10 5
      hch/CObjectHandler.cpp

+ 10 - 5
hch/CObjectHandler.cpp

@@ -4778,14 +4778,19 @@ void CCartographer::onHeroVisit( const CGHeroInstance * h ) const
 		{
 			//ask if he wants to buy one
 			int text;
-			if (cb->getTile(pos)->tertype == 8) //water
-					text = 25;
-			else
+			switch (subID)
 			{
-				if (pos.z == 0)
+				case 0:
+					text = 25;
+					break;
+				case 1:
 					text = 26;
-				else
+					break;
+				case 2:
 					text = 27;
+					break;
+				default:
+					tlog2 << "Unrecognized subtype of cartographer" << std::endl;
 			}
 			BlockingDialog bd (true, false);
 			bd.player = h->getOwner();