If not enough resources, unit didn't stop trying to build.
This commit is contained in:
parent
5fa58b0d81
commit
b3a2fa6aef
1 changed files with 10 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue