Hi.
Yesterday, I installed the SDK and made the following change to CvGameCoreDLL.dll (based on Bhruic's 1.11 code): city governor only builds workers or workboats if the menu option 'workers start automated' is ticked (or there are no other things to build because you don't have researched the proper technologies, and the conditions for building workers or workboats are met). Related forum thread: http://forums.civfanatics.com/showthread.php?t=250781
I have modified CvCityAI::AI_buildGovernorChooseProduction() method with the following changes (in italic), and it seems to work:
//city governor builds a workboat only if 'workers start automated' menu option is ticked
if (GET_PLAYER(getOwnerINLINE()).isOption(PLAYEROPTION_START_AUTOMATED))
{
if (pWaterArea != NULL)
{
if (GET_PLAYER(getOwnerINLINE()).AI_totalWaterAreaUnitAIs(pWaterArea, UNITAI_WORKER_SEA) == 0)
{
if (AI_neededSeaWorkers() > 0)
{
if (AI_chooseUnit(UNITAI_WORKER_SEA))
{
return;
}
}
}
}
}
and:
//city governor builds a worker only if 'workers start automated' menu option is ticked
if (GET_PLAYER(getOwnerINLINE()).isOption(PLAYEROPTION_START_AUTOMATED))
{
int iExistingWorkers = GET_PLAYER(getOwner()).AI_totalAreaUnitAIs(area(), UNITAI_WORKER);
int iNeededWorkers = GET_PLAYER(getOwner()).AI_neededWorkers(area());
if (!bDanger && (iExistingWorkers < ((iNeededWorkers + 1) / 2)))
{
if (AI_chooseUnit(UNITAI_WORKER))
{
return;
}
}
}
I don`t know if this is the right thread to show this or if there's an specific thread to "unofficial patch" code development. If you like the idea, it can be merged into the 'unofficial patch'.
Yesterday, I installed the SDK and made the following change to CvGameCoreDLL.dll (based on Bhruic's 1.11 code): city governor only builds workers or workboats if the menu option 'workers start automated' is ticked (or there are no other things to build because you don't have researched the proper technologies, and the conditions for building workers or workboats are met). Related forum thread: http://forums.civfanatics.com/showthread.php?t=250781
I have modified CvCityAI::AI_buildGovernorChooseProduction() method with the following changes (in italic), and it seems to work:
//city governor builds a workboat only if 'workers start automated' menu option is ticked
if (GET_PLAYER(getOwnerINLINE()).isOption(PLAYEROPTION_START_AUTOMATED))
{
if (pWaterArea != NULL)
{
if (GET_PLAYER(getOwnerINLINE()).AI_totalWaterAreaUnitAIs(pWaterArea, UNITAI_WORKER_SEA) == 0)
{
if (AI_neededSeaWorkers() > 0)
{
if (AI_chooseUnit(UNITAI_WORKER_SEA))
{
return;
}
}
}
}
}
and:
//city governor builds a worker only if 'workers start automated' menu option is ticked
if (GET_PLAYER(getOwnerINLINE()).isOption(PLAYEROPTION_START_AUTOMATED))
{
int iExistingWorkers = GET_PLAYER(getOwner()).AI_totalAreaUnitAIs(area(), UNITAI_WORKER);
int iNeededWorkers = GET_PLAYER(getOwner()).AI_neededWorkers(area());
if (!bDanger && (iExistingWorkers < ((iNeededWorkers + 1) / 2)))
{
if (AI_chooseUnit(UNITAI_WORKER))
{
return;
}
}
}
I don`t know if this is the right thread to show this or if there's an specific thread to "unofficial patch" code development. If you like the idea, it can be merged into the 'unofficial patch'.