whoward69
DLL Minion
I've just played one of the most enjoyable 100+ starting turns of a game ever. Despite marauding barbarians, my workers only stopped what they were doing twice.
Code snippet to only stop workers doing what they are doing if the worker can actually see the danger and not just sniff them on the wind!
In CvUnitsMission.cpp
Code snippet to only stop workers doing what they are doing if the worker can actually see the danger and not just sniff them on the wind!
In CvUnitsMission.cpp
Code:
bool bAbortMission = (!bEscortedBuilder && !hUnit->IsIgnoringDangerWakeup() && !hUnit->IsCombatUnit());
// Stop only if the worker can actually see the enemy
bAbortMission = (bAbortMission && hUnit->SentryAlert());
// or stop if there is any hint of an enemy
// bAbortMission = (bAbortMission && GET_PLAYER(hUnit->getOwner()).GetPlotDanger(*(hUnit->plot())) > 0);
if(bAbortMission)
// if(!bEscortedBuilder && !hUnit->IsIgnoringDangerWakeup() && !hUnit->IsCombatUnit() && GET_PLAYER(hUnit->getOwner()).GetPlotDanger(*(hUnit->plot())) > 0)