From a4c7f88ce99280a6a02008bd717137a4ab6c25bc Mon Sep 17 00:00:00 2001
From: mr-russ <>
Date: Sun, 4 May 2003 07:31:28 +0000
Subject: [PATCH] Made computer reciprocate Shared Vision and Ally Commands

---
 doc/ChangeLog.html     |  1 +
 src/action/command.cpp | 14 ++++++++++++++
 2 files changed, 15 insertions(+)

diff --git a/doc/ChangeLog.html b/doc/ChangeLog.html
index 38b7ee49f..d86660e63 100644
--- a/doc/ChangeLog.html
+++ b/doc/ChangeLog.html
@@ -31,6 +31,7 @@
 <li>Future 1.19 Release<p>
     <ul>
     <li>+++
+    <li>Made computer reciprocate Shared Vision and Ally Commands (from Russell Smith)
     <li>Made the 'make it so' cheat reversable and changes build speed for buildings already under construction (Nehal Mistry).
     <li>Fixed bug #427560: Diplomacy menu button (from Jimmy Salmon).
     <li>Rewrote the UI configuration (from Jimmy Salmon).
diff --git a/src/action/command.cpp b/src/action/command.cpp
index 639382b01..b1b858cde 100644
--- a/src/action/command.cpp
+++ b/src/action/command.cpp
@@ -1373,6 +1373,13 @@ global void CommandAutoSpellCast(Unit* unit,SpellType* spell)
 */
 global void CommandDiplomacy(int player,int state,int opponent)
 {
+    // If we work changing states with a computer, it should
+    // automatically reciprocate the changes :)
+    if( Players[opponent].Type == PlayerComputer && 
+	Players[player].Type == PlayerPerson ) {
+	CommandDiplomacy(opponent,state,player);
+    }
+
     switch( state ) {
 	case DiplomacyNeutral:
 	    Players[player].Enemy&=~(1<<opponent);
@@ -1405,6 +1412,13 @@ global void CommandSharedVision(int player,int state,int opponent)
 {
     int i;
     Unit* unit;
+
+    // If we work changing states with a computer, it should
+    // automatically reciprocate the changes :)
+    if( Players[opponent].Type == PlayerComputer && 
+	Players[player].Type == PlayerPerson ) {
+	CommandSharedVision(opponent,state,player);
+    }
     
     if( state==0 ) {
 	// Check all tiles and mark unseen ones as explored.