CvPlayerEspionage::IsAnySchmoozing(CvCity *)
- Defined in
- CvEspionageClasses.cpp, line 2014
- Class
- CvPlayerEspionage
- Hook name
CivHooks::CvPlayerEspionage_IsAnySchmoozing
Hooks
static bool BeforeCvPlayerEspionage_IsAnySchmoozing(CvPlayerEspionage* self, CvCity* pCity, bool& result);static void AfterCvPlayerEspionage_IsAnySchmoozing(CvPlayerEspionage* self, CvCity* pCity, bool& result);static bool ReplaceCvPlayerEspionage_IsAnySchmoozing(bool (*original)(CvPlayerEspionage*, CvCity*), CvPlayerEspionage* self, CvCity* pCity);CivRegisterBefore<CivHooks::CvPlayerEspionage_IsAnySchmoozing>(host, &BeforeCvPlayerEspionage_IsAnySchmoozing);CivRegisterAfter<CivHooks::CvPlayerEspionage_IsAnySchmoozing>(host, &AfterCvPlayerEspionage_IsAnySchmoozing);CivRegisterReplace<CivHooks::CvPlayerEspionage_IsAnySchmoozing>(host, &ReplaceCvPlayerEspionage_IsAnySchmoozing);
Code
2014bool CvPlayerEspionage::IsAnySchmoozing (CvCity* pCity)2015{2016 for(uint uiSpy = 0; uiSpy < m_aSpyList.size(); uiSpy++)2017 {2018 // can't have established surveillance when not in a city2019 if(!IsSpyInCity(uiSpy))2020 {2021 continue;2022 }20232024 CvPlot* pPlot = GC.getMap().plot(m_aSpyList[uiSpy].m_iCityX, m_aSpyList[uiSpy].m_iCityY);2025 CvAssertMsg(pPlot, "Spy coordinates did not point to plot");2026 if(!pPlot)2027 {2028 return false;2029 }2030 CvCity* pPlotCity = pPlot->getPlotCity();2031 CvAssertMsg(pPlotCity, "There is not a city at the specified plot");2032 if(!pPlotCity)2033 {2034 return false;2035 }2036 if(pCity == pPlotCity && IsSchmoozing(uiSpy))2037 {2038 return true;2039 }2040 }20412042 return false;2043}
Calls
BaseVector::operator[]BaseVector::size- CvGlobals::getMap()
- CvMap::plot(int, int) const
- CvPlayerEspionage::IsSchmoozing(uint)
- CvPlayerEspionage::IsSpyInCity(uint)
- CvPlot::getPlotCity() const