瀏覽代碼

Allow learning secondary skills in ally towns

Dydzio 6 年之前
父節點
當前提交
c310a05ee0
共有 1 個文件被更改,包括 6 次插入2 次删除
  1. 6 2
      server/NetPacksServer.cpp

+ 6 - 2
server/NetPacksServer.cpp

@@ -199,10 +199,14 @@ bool TradeOnMarketplace::applyGh(CGameHandler * gh)
 	if(player >= PlayerColor::PLAYER_LIMIT)
 		throwAndComplain(gh, "No player can use this market!");
 
-	if(hero && (player != hero->tempOwner || hero->visitablePos() != market->visitablePos()))
+	bool allyTownSkillTrade = (mode == EMarketMode::RESOURCE_SKILL && gh->getPlayerRelations(player, hero->tempOwner) == PlayerRelations::ALLIES);
+
+	if(hero && (!(player == hero->tempOwner || allyTownSkillTrade)
+		|| hero->visitablePos() != market->visitablePos()))
 		throwAndComplain(gh, "This hero can't use this marketplace!");
 
-	throwOnWrongPlayer(gh, player);
+	if(!allyTownSkillTrade)
+		throwOnWrongPlayer(gh, player);
 
 	bool result = true;