Fixed bug when destination is destroyed

This commit is contained in:
jsalmon3 2003-03-10 06:29:54 +00:00
parent 558895647d
commit d9156f2abb
3 changed files with 10 additions and 19 deletions

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;