From fdac23c7d0b64ee97d2ce04bf5e040365ad77661 Mon Sep 17 00:00:00 2001
From: jsalmon3 <>
Date: Sat, 25 Jan 2003 04:01:32 +0000
Subject: [PATCH] Can repair ally buildings

---
 src/ui/mouse.cpp | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/ui/mouse.cpp b/src/ui/mouse.cpp
index 5fda66f28..eaeeb14b9 100644
--- a/src/ui/mouse.cpp
+++ b/src/ui/mouse.cpp
@@ -272,7 +272,8 @@ global void DoRightButton(int sx,int sy)
 
 	    // cade: this is default repair action
 	    dest=RepairableOnScreenMapPosition(sx, sy);
-	    if( dest && dest->Type && dest->Player==ThisPlayer ) {
+	    if( dest && dest->Type && (dest->Player==ThisPlayer
+		    || IsAllied(ThisPlayer,dest)) ) {
 		SendCommandRepair(unit,x,y,dest,flush);
 		continue;
 	    }
@@ -795,7 +796,8 @@ local void SendRepair(int sx,int sy)
     int y;
 
     dest=RepairableOnScreenMapPosition(sx,sy);
-    if( !dest || !dest->Type || dest->Player!=ThisPlayer ) {
+    if( !(dest && dest->Type && (dest->Player==ThisPlayer
+	    || IsAllied(ThisPlayer,dest))) ) {
 	// FIXME: Should move test in repairable
 	dest=NoUnitP;
     }