Browse Source

Bit refactoring

nordsoft 2 years ago
parent
commit
07b2052679
2 changed files with 5 additions and 2 deletions
  1. 1 1
      client/windows/CTradeWindow.cpp
  2. 4 1
      lib/mapObjects/CommonConstructors.cpp

+ 1 - 1
client/windows/CTradeWindow.cpp

@@ -703,7 +703,7 @@ CMarketplaceWindow::CMarketplaceWindow(const IMarket * Market, const CGHeroInsta
 	}
 	else if(auto * o = dynamic_cast<const CGMarket *>(market))
 	{
-		title = o->title.empty() ? o->getObjectName() : o->title;
+		title = o->title;
 	}
 
 	titleLabel = std::make_shared<CLabel>(300, 27, FONT_BIG, ETextAlignment::CENTER, Colors::YELLOW, title);

+ 4 - 1
lib/mapObjects/CommonConstructors.cpp

@@ -335,7 +335,10 @@ CGObjectInstance * MarketInstanceConstructor::create(std::shared_ptr<const Objec
 	if(marketEfficacy >= 0)
 		market->marketEfficacy = marketEfficacy;
 	
-	market->title = VLC->generaltexth->translate(title);
+	market->title = market->getObjectName();
+	if(!title.empty())
+		market->title = VLC->generaltexth->translate(title);
+	
 	market->speech = VLC->generaltexth->translate(speech);
 	
 	return market;