Fixed bug when destination is destroyed
This commit is contained in:
parent
558895647d
commit
d9156f2abb
3 changed files with 10 additions and 19 deletions
|
@ -272,11 +272,8 @@ local int ReturnWithWood(Unit* unit)
|
|||
DebugCheck( !destu );
|
||||
|
||||
i=DoActionMove(unit);
|
||||
if( i==0 ) {
|
||||
return 0;
|
||||
}
|
||||
if( i>0 && !(destu->Destroyed || destu->Removed || !destu->HP
|
||||
|| destu->Orders[0].Action==UnitActionDie) ) {
|
||||
if( i>=0 && (!unit->Reset || !(destu->Destroyed || destu->Removed
|
||||
|| !destu->HP || destu->Orders[0].Action==UnitActionDie)) ) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -62,11 +62,8 @@ local int MoveToGoldMine(Unit* unit)
|
|||
DebugCheck( !destu );
|
||||
|
||||
i=DoActionMove(unit);
|
||||
if( i==0 ) {
|
||||
return 0;
|
||||
}
|
||||
if( i>0 && !(destu->Destroyed || destu->Removed || !destu->HP
|
||||
|| destu->Orders[0].Action==UnitActionDie) ) {
|
||||
if( i>=0 && (!unit->Reset || !(destu->Destroyed || destu->Removed
|
||||
|| !destu->HP || destu->Orders[0].Action==UnitActionDie)) ) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -356,11 +353,8 @@ local int MoveToGoldDeposit(Unit* unit)
|
|||
DebugCheck( !destu );
|
||||
|
||||
i=DoActionMove(unit);
|
||||
if( i==0 ) {
|
||||
return 0;
|
||||
}
|
||||
if( i>0 && !(destu->Destroyed || destu->Removed || !destu->HP
|
||||
|| destu->Orders[0].Action==UnitActionDie) ) {
|
||||
if( i>=0 && (!unit->Reset || !(destu->Destroyed || destu->Removed
|
||||
|| !destu->HP || destu->Orders[0].Action==UnitActionDie)) ) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -95,8 +95,8 @@ local int MoveToResource(Unit* unit,const Resource* resource)
|
|||
case PF_REACHED:
|
||||
break;
|
||||
default:
|
||||
if( !(goal->Destroyed || goal->Removed || !goal->HP
|
||||
|| goal->Orders[0].Action==UnitActionDie) ) {
|
||||
if( !unit->Reset || !(goal->Destroyed || goal->Removed
|
||||
|| !goal->HP || goal->Orders[0].Action==UnitActionDie) ) {
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
|
@ -346,8 +346,8 @@ local int MoveToDepot(Unit* unit,const Resource* resource)
|
|||
case PF_REACHED:
|
||||
break;
|
||||
default:
|
||||
if( !(goal->Destroyed || goal->Removed || !goal->HP
|
||||
|| goal->Orders[0].Action==UnitActionDie) ) {
|
||||
if( !unit->Reset || !(goal->Destroyed || goal->Removed
|
||||
|| !goal->HP || goal->Orders[0].Action==UnitActionDie) ) {
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
|
|
Loading…
Add table
Reference in a new issue