浏览代码

Merge pull request #64 from ArseniyShestakov/fixCartographerCrash

Fix crash on stalagmite Cartographer if there is no underground level
DjWarmonger 11 年之前
父节点
当前提交
5beaf42ebc
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      lib/mapObjects/MiscObjects.cpp

+ 2 - 1
lib/mapObjects/MiscObjects.cpp

@@ -1445,7 +1445,8 @@ void CGShipyard::onHeroVisit( const CGHeroInstance * h ) const
 
 void CCartographer::onHeroVisit( const CGHeroInstance * h ) const
 {
-	if (!wasVisited (h->getOwner()) ) //if hero has not visited yet this cartographer
+	//if player has not bought map of this subtype yet and underground exist for stalagmite cartographer
+	if (!wasVisited(h->getOwner()) && (subID != 2 || cb->gameState()->map->twoLevel))
 	{
 		if (cb->getResource(h->tempOwner, Res::GOLD) >= 1000) //if he can afford a map
 		{