From a4760fca73a6762c046da0499478e619ee89e95d Mon Sep 17 00:00:00 2001
From: Tim Felgentreff <timfelgentreff@gmail.com>
Date: Thu, 23 May 2013 00:37:52 +0200
Subject: [PATCH] buildings can build buildings if they are within repair range

---
 src/action/command.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/action/command.cpp b/src/action/command.cpp
index 97c963731..ebca6cb98 100644
--- a/src/action/command.cpp
+++ b/src/action/command.cpp
@@ -486,7 +486,7 @@ void CommandBuildBuilding(CUnit &unit, const Vec2i &pos, CUnitType &what, int fl
 	}
 	COrderPtr *order;
 
-	if (unit.Type->Building) {
+	if (unit.Type->Building && !what.BuilderOutside && unit.MapDistanceTo(pos) > unit.Type->RepairRange) {
 		ClearNewAction(unit);
 		order = &unit.NewOrder;
 	} else {