Bazaar developer reference

CvPlayer::DoUnitAttrition()

Defined in
CvPlayer.cpp, line 5124
Class
CvPlayer
Hook name
CivHooks::CvPlayer_DoUnitAttrition

Hooks

static bool BeforeCvPlayer_DoUnitAttrition(CvPlayer* self);static void AfterCvPlayer_DoUnitAttrition(CvPlayer* self);static void ReplaceCvPlayer_DoUnitAttrition(void (*original)(CvPlayer*), CvPlayer* self);CivRegisterBefore<CivHooks::CvPlayer_DoUnitAttrition>(host, &BeforeCvPlayer_DoUnitAttrition);CivRegisterAfter<CivHooks::CvPlayer_DoUnitAttrition>(host, &AfterCvPlayer_DoUnitAttrition);CivRegisterReplace<CivHooks::CvPlayer_DoUnitAttrition>(host, &ReplaceCvPlayer_DoUnitAttrition);

Code

5123/// Damage units from attrition (start of turn so we can get notifications)5124void CvPlayer::DoUnitAttrition()5125{5126	CvUnit* pLoopUnit;5127	int iLoop;51285129	for(pLoopUnit = firstUnit(&iLoop); pLoopUnit != NULL; pLoopUnit = nextUnit(&iLoop))5130	{5131		pLoopUnit->DoAttrition();5132	}5133}

Calls

Called by