Bazaar developer reference

CvUnit::AI_setUnitAIType(UnitAITypes)

Defined in
CvUnit.cpp, line 24330
Class
CvUnit
Hook name
CivHooks::CvUnit_AI_setUnitAIType

Hooks

static bool BeforeCvUnit_AI_setUnitAIType(CvUnit* self, UnitAITypes eNewValue);static void AfterCvUnit_AI_setUnitAIType(CvUnit* self, UnitAITypes eNewValue);static void ReplaceCvUnit_AI_setUnitAIType(void (*original)(CvUnit*, UnitAITypes), CvUnit* self, UnitAITypes eNewValue);CivRegisterBefore<CivHooks::CvUnit_AI_setUnitAIType>(host, &BeforeCvUnit_AI_setUnitAIType);CivRegisterAfter<CivHooks::CvUnit_AI_setUnitAIType>(host, &AfterCvUnit_AI_setUnitAIType);CivRegisterReplace<CivHooks::CvUnit_AI_setUnitAIType>(host, &ReplaceCvUnit_AI_setUnitAIType);

Code

24330void CvUnit::AI_setUnitAIType(UnitAITypes eNewValue)24331{24332	VALIDATE_OBJECT24333	CvAssertMsg(eNewValue != NO_UNITAI, "NewValue is not assigned a valid value");2433424335	if(AI_getUnitAIType() != eNewValue)24336	{24337		m_eUnitAIType = eNewValue;24338	}24339}

Calls

Called by