Hooks
static bool BeforeCvUnit_init(CvUnit* self, int iID, UnitTypes eUnit, UnitAITypes eUnitAI, PlayerTypes eOwner, int iX, int iY, DirectionTypes eFacingDirection, bool bNoMove, bool bSetupGraphical, int iMapLayer, int iNumGoodyHutsPopped);static void AfterCvUnit_init(CvUnit* self, int iID, UnitTypes eUnit, UnitAITypes eUnitAI, PlayerTypes eOwner, int iX, int iY, DirectionTypes eFacingDirection, bool bNoMove, bool bSetupGraphical, int iMapLayer, int iNumGoodyHutsPopped);static void ReplaceCvUnit_init(void (*original)(CvUnit*, int, UnitTypes, UnitAITypes, PlayerTypes, int, int, DirectionTypes, bool, bool, int, int), CvUnit* self, int iID, UnitTypes eUnit, UnitAITypes eUnitAI, PlayerTypes eOwner, int iX, int iY, DirectionTypes eFacingDirection, bool bNoMove, bool bSetupGraphical, int iMapLayer, int iNumGoodyHutsPopped);CivRegisterBefore<CivHooks::CvUnit_init>(host, &BeforeCvUnit_init);CivRegisterAfter<CivHooks::CvUnit_init>(host, &AfterCvUnit_init);CivRegisterReplace<CivHooks::CvUnit_init>(host, &ReplaceCvUnit_init);
Code
418void CvUnit::init(int iID, UnitTypes eUnit, UnitAITypes eUnitAI, PlayerTypes eOwner, int iX, int iY, DirectionTypes eFacingDirection, bool bNoMove, bool bSetupGraphical, int iMapLayer /*= DEFAULT_UNIT_MAP_LAYER*/, int iNumGoodyHutsPopped)419{420 initWithNameOffset(iID, eUnit, -1, eUnitAI, eOwner, iX, iY, eFacingDirection, bNoMove, bSetupGraphical, iMapLayer, iNumGoodyHutsPopped);421}