Fix chopping wood. (Bug introduced by rev.8737).
Fix unitTest.
This commit is contained in:
parent
2b3dacf61d
commit
e64b56d0fb
2 changed files with 5 additions and 3 deletions
|
@ -1103,11 +1103,12 @@ bool COrder_Resource::ActionResourceInit(CUnit &unit)
|
||||||
unit.DeAssignWorkerFromMine(*mine);
|
unit.DeAssignWorkerFromMine(*mine);
|
||||||
this->Resource.Mine = NULL;
|
this->Resource.Mine = NULL;
|
||||||
}
|
}
|
||||||
if (goal && goal->IsAlive() && goal->CurrentAction() != UnitActionBuilt) {
|
if (goal && goal->IsAlive() == false) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (goal && goal->CurrentAction() != UnitActionBuilt) {
|
||||||
unit.AssignWorkerToMine(*goal);
|
unit.AssignWorkerToMine(*goal);
|
||||||
this->Resource.Mine = goal;
|
this->Resource.Mine = goal;
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
UnitGotoGoal(unit, goal, SUB_MOVE_TO_RESOURCE);
|
UnitGotoGoal(unit, goal, SUB_MOVE_TO_RESOURCE);
|
||||||
|
|
|
@ -53,6 +53,7 @@ void FillCustomValue(CServerSetup *obj)
|
||||||
obj->GameTypeOption = 52;
|
obj->GameTypeOption = 52;
|
||||||
obj->Difficulty = 54;
|
obj->Difficulty = 54;
|
||||||
obj->MapRichness = 56;
|
obj->MapRichness = 56;
|
||||||
|
obj->Opponents = 58;
|
||||||
for (int i = 0; i != PlayerMax; ++i) {
|
for (int i = 0; i != PlayerMax; ++i) {
|
||||||
obj->CompOpt[i] = i + 1;
|
obj->CompOpt[i] = i + 1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue