Bazaar developer reference

CvCity::setProductionAutomated(bool, bool)

Defined in
CvCity.cpp, line 10201
Class
CvCity
Hook name
CivHooks::CvCity_setProductionAutomated

Hooks

static bool BeforeCvCity_setProductionAutomated(CvCity* self, bool bNewValue, bool bClear);static void AfterCvCity_setProductionAutomated(CvCity* self, bool bNewValue, bool bClear);static void ReplaceCvCity_setProductionAutomated(void (*original)(CvCity*, bool, bool), CvCity* self, bool bNewValue, bool bClear);CivRegisterBefore<CivHooks::CvCity_setProductionAutomated>(host, &BeforeCvCity_setProductionAutomated);CivRegisterAfter<CivHooks::CvCity_setProductionAutomated>(host, &AfterCvCity_setProductionAutomated);CivRegisterReplace<CivHooks::CvCity_setProductionAutomated>(host, &ReplaceCvCity_setProductionAutomated);

Code

10201void CvCity::setProductionAutomated(bool bNewValue, bool bClear)10202{10203	VALIDATE_OBJECT10204	if(isProductionAutomated() != bNewValue)10205	{10206		m_bProductionAutomated = bNewValue;1020710208		if((getOwner() == GC.getGame().getActivePlayer()) && isCitySelected())10209		{10210			DLLUI->setDirty(SelectionButtons_DIRTY_BIT, true);10211		}1021210213		// if automated and not network game and all 3 modifiers down, clear the queue and choose again10214		if(bNewValue && bClear)10215		{10216			clearOrderQueue();10217		}10218		if(!isProduction())10219		{10220			AI_chooseProduction(false /*bInterruptWonders*/);10221		}10222	}10223}

Calls

Called by