From 93ac37b241aafa569886c97afbfe0b7cb9b7411e Mon Sep 17 00:00:00 2001
From: johns <>
Date: Sun, 13 Aug 2000 20:02:18 +0000
Subject: [PATCH] Fixed bug: trying to train new units with filled training
 queue costs money.

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

diff --git a/src/ui/botpanel.cpp b/src/ui/botpanel.cpp
index 9a2c58c3a..7fab2c334 100644
--- a/src/ui/botpanel.cpp
+++ b/src/ui/botpanel.cpp
@@ -705,11 +705,14 @@ global void DoButtonButtonClicked(int button)
 		MustRedraw|=RedrawCursor;
 	    }
 	    break;
+
 	case B_Train:
 	    type=&UnitTypes[CurrentButtons[button].Value];
-	    // FIXME: Johns: I want to place commands in que, even if not
+	    // FIXME: Johns: I want to place commands in queue, even if not
 	    // FIXME: enought resources are available
-	    if( PlayerCheckFood(ThisPlayer,type)
+	    if( Selected[0]->Command.Data.Train.Count==MAX_UNIT_TRAIN ) {
+		SetMessage( "Unit training queue is full" );
+	    } else if( PlayerCheckFood(ThisPlayer,type)
 			&& !PlayerCheckUnitType(ThisPlayer,type) ) {
 		PlayerSubUnitType(ThisPlayer,type);
 		SendCommandTrainUnit(Selected[0],type
@@ -720,6 +723,7 @@ global void DoButtonButtonClicked(int button)
 		MustRedraw|=RedrawInfoPanel;
 	    }
 	    break;
+
 	case B_UpgradeTo:
 	    type=&UnitTypes[CurrentButtons[button].Value];
 	    if( !PlayerCheckUnitType(ThisPlayer,type) ) {