Hooks
static bool BeforeCvDllMap_FindCity(CvDllMap* self, int iX, int iY, PlayerTypes eOwner, TeamTypes eTeam, bool bSameArea, bool bCoastalOnly, TeamTypes eTeamAtWarWith, DirectionTypes eDirection, ICvCity1* pSkipCity, ICvCity1*& result);static void AfterCvDllMap_FindCity(CvDllMap* self, int iX, int iY, PlayerTypes eOwner, TeamTypes eTeam, bool bSameArea, bool bCoastalOnly, TeamTypes eTeamAtWarWith, DirectionTypes eDirection, ICvCity1* pSkipCity, ICvCity1*& result);static ICvCity1* ReplaceCvDllMap_FindCity(ICvCity1* (*original)(CvDllMap*, int, int, PlayerTypes, TeamTypes, bool, bool, TeamTypes, DirectionTypes, ICvCity1*), CvDllMap* self, int iX, int iY, PlayerTypes eOwner, TeamTypes eTeam, bool bSameArea, bool bCoastalOnly, TeamTypes eTeamAtWarWith, DirectionTypes eDirection, ICvCity1* pSkipCity);// CivHooks.h gives this hook point no types, so nothing checks these hooks' parameters.host->RegisterHook(host->pluginIndex, CivHooks::CvDllMap_FindCity::ID, CIV_HOOK_BEFORE, (void*)&BeforeCvDllMap_FindCity);host->RegisterHook(host->pluginIndex, CivHooks::CvDllMap_FindCity::ID, CIV_HOOK_AFTER, (void*)&AfterCvDllMap_FindCity);host->RegisterHook(host->pluginIndex, CivHooks::CvDllMap_FindCity::ID, CIV_HOOK_REPLACE, (void*)&ReplaceCvDllMap_FindCity);
Code
107ICvCity1* CvDllMap::FindCity(int iX,108 int iY,109 PlayerTypes eOwner,110 TeamTypes eTeam ,111 bool bSameArea ,112 bool bCoastalOnly,113 TeamTypes eTeamAtWarWith,114 DirectionTypes eDirection,115 ICvCity1* pSkipCity)116{117 CvCity* pkSkipCity = NULL;118 if(pSkipCity)119 {120 pkSkipCity = static_cast<CvDllCity*>(pSkipCity)->GetInstance();121 }122123 CvCity* pkCity = m_pMap->findCity(iX, iY, eOwner, eTeam, bSameArea, bCoastalOnly, eTeamAtWarWith, eDirection, pkSkipCity);124 return (NULL != pkCity)? new CvDllCity(pkCity) : NULL;125}