diff --git a/src/action/action_harvest.cpp b/src/action/action_harvest.cpp index 0340e6c7a..e43ed907b 100644 --- a/src/action/action_harvest.cpp +++ b/src/action/action_harvest.cpp @@ -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; } diff --git a/src/action/action_minegold.cpp b/src/action/action_minegold.cpp index 968fe95c2..1a09e776f 100644 --- a/src/action/action_minegold.cpp +++ b/src/action/action_minegold.cpp @@ -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; } diff --git a/src/action/action_resource.cpp b/src/action/action_resource.cpp index 503a8caf1..a27008d77 100644 --- a/src/action/action_resource.cpp +++ b/src/action/action_resource.cpp @@ -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;