Fixed bug #697744: cannot cancel patrol when mixed units selected

This commit is contained in:
jsalmon3 2003-05-20 21:42:02 +00:00
parent 427774e544
commit 9cd9714441
2 changed files with 30 additions and 3 deletions

View file

@ -70,6 +70,8 @@
<p><li>Future 1.18.1 Release<p>
<ul>
<li>+++
<li>Fixed bug #697744: cannot cancel patrol when mixed units selected (from Jimmy Salmon).
<li>Fixed bug #703143: Can't give orders to units (from Russell Smith).
<li>Fixed bug #697741: tileset not drawn when loading saved game (from Jimmy Salmon).
<li>Save preferences after toggling fullscreen mode (from Nehal Mistry).
<li>Fixed bug #696172: Train units beyond set-all-players-food-unit-limit (from Jimmy Salmon).

View file

@ -10,7 +10,8 @@
//
/**@name botpanel.c - The bottom panel. */
//
// (c) Copyright 1999-2003 by Lutz Sammer, Vladi Belperchinov-Shabanski
// (c) Copyright 1999-2003 by Lutz Sammer, Vladi Belperchinov-Shabanski,
// and Jimmy Salmon
//
// FreeCraft is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published
@ -588,8 +589,8 @@ local void UpdateButtonPanelMultipleUnits(void)
}
// any unit or unit in list
if ( UnitButtonTable[z]->UnitMask[0] != '*'
&& strstr( UnitButtonTable[z]->UnitMask, unit_ident ) ) {
if ( UnitButtonTable[z]->UnitMask[0] == '*'
|| strstr( UnitButtonTable[z]->UnitMask, unit_ident ) ) {
int allow;
allow=0;
@ -623,6 +624,30 @@ local void UpdateButtonPanelMultipleUnits(void)
break;
}
}
} else if ( UnitButtonTable[z]->Action == ButtonCancel ) {
allow = 1;
} else if ( UnitButtonTable[z]->Action == ButtonCancelUpgrade ) {
for( i=NumSelected; --i; ) {
if( Selected[i]->Orders[0].Action==UnitActionUpgradeTo
|| Selected[i]->Orders[0].Action==UnitActionResearch ) {
allow = 1;
break;
}
}
} else if ( UnitButtonTable[z]->Action == ButtonCancelTrain ) {
for( i=NumSelected; --i; ) {
if( Selected[i]->Orders[0].Action==UnitActionTrain ) {
allow = 1;
break;
}
}
} else if ( UnitButtonTable[z]->Action == ButtonCancelBuild ) {
for( i=NumSelected; --i; ) {
if( Selected[i]->Orders[0].Action==UnitActionBuilded ) {
allow = 1;
break;
}
}
} else {
allow = 1;
}