浏览代码

Block AI from acting at the same time as guest-human during simturns

Ivan Savenko 1 年之前
父节点
当前提交
6300473ff8
共有 1 个文件被更改,包括 7 次插入4 次删除
  1. 7 4
      server/processors/TurnOrderProcessor.cpp

+ 7 - 4
server/processors/TurnOrderProcessor.cpp

@@ -177,13 +177,16 @@ bool TurnOrderProcessor::computeCanActSimultaneously(PlayerColor active, PlayerC
 	assert(activeInfo);
 	assert(waitingInfo);
 
-	if (gameHandler->hasBothPlayersAtSameConnection(active, waiting))
+	if (activeInfo->human != waitingInfo->human)
 	{
+		// only one AI and one human can play simultaneoulsy from single connection
 		if (!gameHandler->getStartInfo()->simturnsInfo.allowHumanWithAI)
 			return false;
-
-		// only one AI and one human can play simultaneoulsy from single connection
-		if (activeInfo->human == waitingInfo->human)
+	}
+	else
+	{
+		// two AI or two humans in hotseat can't play at the same time
+		if (gameHandler->hasBothPlayersAtSameConnection(active, waiting))
 			return false;
 	}