From 0efa0fe7c2f1988e1cb89e9fff1b2ce830e5b03d Mon Sep 17 00:00:00 2001
From: johns <>
Date: Fri, 8 Mar 2002 16:26:51 +0000
Subject: [PATCH] Handle that the buildings is already repaired.

---
 src/action/action_repair.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/action/action_repair.cpp b/src/action/action_repair.cpp
index 2fcb7864e..723e5d119 100644
--- a/src/action/action_repair.cpp
+++ b/src/action/action_repair.cpp
@@ -246,8 +246,9 @@ global void HandleActionRepair(Unit* unit)
 			// FIXME: should I clear this here?
 			unit->Orders[0].Goal=goal=NULL;
 			NewResetPath(unit);
-		    } else if( !goal->HP ||
-				goal->Orders[0].Action==UnitActionDie ) {
+		    } else if( !goal->HP
+				|| goal->Orders[0].Action==UnitActionDie
+				|| goal->HP > goal->Stats->HitPoints ) {
 			unit->Orders[0].X=goal->X;
 			unit->Orders[0].Y=goal->Y;
 			RefsDebugCheck( !goal->Refs );