浏览代码

cheats + grail in town

Laserlicht 2 年之前
父节点
当前提交
c49d38b855
共有 2 个文件被更改,包括 9 次插入0 次删除
  1. 3 0
      client/CPlayerInterface.cpp
  2. 6 0
      server/processors/PlayerMessageProcessor.cpp

+ 3 - 0
client/CPlayerInterface.cpp

@@ -1695,6 +1695,9 @@ void CPlayerInterface::requestReturningToMainMenu(bool won)
 	for(const CGHeroInstance * h : cb->getHeroesInfo())
 		if(h->hasArt(ArtifactID::GRAIL))
 			param.hasGrail = true;
+	for(const CGTownInstance * t : cb->getTownInfo())
+		if(t->builtBuildings.find(BuildingID::GRAIL))
+			param.hasGrail = true;
 	param.allDefeated = true;
 	for (PlayerColor player(0); player < PlayerColor::PLAYER_LIMIT; ++player)
 	{

+ 6 - 0
server/processors/PlayerMessageProcessor.cpp

@@ -513,7 +513,13 @@ void PlayerMessageProcessor::executeCheatCode(const std::string & cheatName, Pla
 
 	assert(callbacks.count(cheatName));
 	if (callbacks.count(cheatName))
+	{
+		PlayerCheated pc;
+		pc.player = player;
+		gameHandler->sendAndApply(&pc);
+
 		callbacks.at(cheatName)();
+	}
 }
 
 void PlayerMessageProcessor::sendSystemMessage(std::shared_ptr<CConnection> connection, const std::string & message)