Laserlicht 1 سال پیش
والد
کامیت
97f49030d2
2فایلهای تغییر یافته به همراه5 افزوده شده و 2 حذف شده
  1. 3 0
      client/lobby/OptionsTab.cpp
  2. 2 2
      server/CVCMIServer.cpp

+ 3 - 0
client/lobby/OptionsTab.cpp

@@ -925,6 +925,9 @@ OptionsTab::PlayerOptionsEntry::PlayerOptionsEntry(const PlayerSettings & S, con
 
 
 	labelHandicap = std::make_shared<CMultiLineLabel>(Rect(56, 24, 49, (int)graphics->fonts[EFonts::FONT_TINY]->getLineHeight()*2), EFonts::FONT_TINY, ETextAlignment::CENTER, Colors::WHITE, s->handicap.empty() ? CGI->generaltexth->arraytxt[210] : MetaString::createFromTextID("vcmi.lobby.handicap").toString());
 	labelHandicap = std::make_shared<CMultiLineLabel>(Rect(56, 24, 49, (int)graphics->fonts[EFonts::FONT_TINY]->getLineHeight()*2), EFonts::FONT_TINY, ETextAlignment::CENTER, Colors::WHITE, s->handicap.empty() ? CGI->generaltexth->arraytxt[210] : MetaString::createFromTextID("vcmi.lobby.handicap").toString());
 	handicap = std::make_shared<LRClickableArea>(Rect(56, 24, 49, (int)graphics->fonts[EFonts::FONT_TINY]->getLineHeight()*2), [this](){
 	handicap = std::make_shared<LRClickableArea>(Rect(56, 24, 49, (int)graphics->fonts[EFonts::FONT_TINY]->getLineHeight()*2), [this](){
+		if(!CSH->isHost())
+			return;
+
 		TResources resources = TResources();
 		TResources resources = TResources();
 		resources[EGameResID::GOLD] = 50000;
 		resources[EGameResID::GOLD] = 50000;
 		CSH->setPlayerHandicap(s->color, resources);
 		CSH->setPlayerHandicap(s->color, resources);

+ 2 - 2
server/CVCMIServer.cpp

@@ -1052,7 +1052,7 @@ void CVCMIServer::multiplayerWelcomeMessage()
 	gh->playerMessages->broadcastSystemMessage("Use '!help' to list available commands");
 	gh->playerMessages->broadcastSystemMessage("Use '!help' to list available commands");
 
 
 	for (const auto & pi : si->playerInfos)
 	for (const auto & pi : si->playerInfos)
-		if(pi.second.isControlledByHuman() && !pi.second.handicap.empty())
+		if(!pi.second.handicap.empty())
 		{
 		{
 			MetaString str;
 			MetaString str;
 			str.appendTextID("vcmi.lobby.handicap");
 			str.appendTextID("vcmi.lobby.handicap");
@@ -1067,7 +1067,7 @@ void CVCMIServer::multiplayerWelcomeMessage()
 					str.appendRawString(":");
 					str.appendRawString(":");
 					str.appendRawString(std::to_string(pi.second.handicap[res]));
 					str.appendRawString(std::to_string(pi.second.handicap[res]));
 				}
 				}
-			announceTxt(str);
+			gh->playerMessages->broadcastSystemMessage(str);
 		}
 		}
 
 
 	std::vector<std::string> optionIds;
 	std::vector<std::string> optionIds;