瀏覽代碼

Merge pull request #2919 from Nordsoft91/fix-2893

Nordsoft91 2 年之前
父節點
當前提交
1f2ca138dd
共有 1 個文件被更改,包括 10 次插入0 次删除
  1. 10 0
      lib/mapObjects/CGCreature.cpp

+ 10 - 0
lib/mapObjects/CGCreature.cpp

@@ -103,6 +103,16 @@ std::string CGCreature::getHoverText(const CGHeroInstance * hero) const
 
 void CGCreature::onHeroVisit( const CGHeroInstance * h ) const
 {
+	//show message
+	if(!message.empty())
+	{
+		InfoWindow iw;
+		iw.player = h->tempOwner;
+		iw.text.appendRawString(message);
+		iw.type = EInfoWindowMode::MODAL;
+		cb->showInfoDialog(&iw);
+	}
+	
 	int action = takenAction(h);
 	switch( action ) //decide what we do...
 	{