From 72b0b413753df48ee5f4e38934c9ddc65f7bfcc1 Mon Sep 17 00:00:00 2001
From: jsalmon3 <>
Date: Wed, 19 Mar 2003 03:46:17 +0000
Subject: [PATCH] Removed hard coded position for displaying unit hp

---
 src/ui/mainscr.cpp | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/ui/mainscr.cpp b/src/ui/mainscr.cpp
index 2788f5692..a7faab651 100644
--- a/src/ui/mainscr.cpp
+++ b/src/ui/mainscr.cpp
@@ -196,16 +196,17 @@ global void DrawUnitInfo(const Unit* unit)
 	    ,x,y);
     UiDrawLifeBar(unit,x,y);
 
-    x=TheUI.InfoPanelX;
-    y=TheUI.InfoPanelY;
-
     if( unit->Player==ThisPlayer ) {	// Only for own units.
 	if( unit->HP && unit->HP<10000 ) {
 	    sprintf(buf,"%d/%d",unit->HP,stats->HitPoints);
-	    VideoDrawTextCentered(x+12+23,y+8+53,SmallFont,buf);
+	    VideoDrawTextCentered(x+(type->Icon.Icon->Width+7)/2
+		    ,y+type->Icon.Icon->Height+7+7+3,SmallFont,buf);
 	}
     }
 
+    x=TheUI.InfoPanelX;
+    y=TheUI.InfoPanelY;
+
     //
     //	Draw unit name centered, if too long split at space.
     //