If not enough resources, unit didn't stop trying to build.

This commit is contained in:
johns 2001-04-28 20:26:29 +00:00
parent 5fa58b0d81
commit b3a2fa6aef

View file

@ -136,9 +136,18 @@ global void HandleActionBuild(Unit* unit)
// Check if enough resources for the building.
//
if( PlayerCheckUnitType(unit->Player,type) ) {
if( unit->Player!=ThisPlayer ) {
// FIXME: use general notify/messages
if( unit->Player==ThisPlayer ) {
SetMessage("Not enough resources to build %s.", type->Name);
} else {
AiCanNotBuild(unit,type);
}
unit->Orders[0].Action=UnitActionStill;
unit->SubAction=0;
if( unit->Selected ) { // update display for new action
UpdateButtonPanel();
}
return;
}
PlayerSubUnitType(unit->Player,type);