Bazaar developer reference

CvTacticalAI::PlotAlreadyTargeted(CvPlot *)

Defined in
CvTacticalAI.cpp, line 778
Class
CvTacticalAI
Hook name
CivHooks::CvTacticalAI_PlotAlreadyTargeted

Hooks

static bool BeforeCvTacticalAI_PlotAlreadyTargeted(CvTacticalAI* self, CvPlot* pPlot, int& result);static void AfterCvTacticalAI_PlotAlreadyTargeted(CvTacticalAI* self, CvPlot* pPlot, int& result);static int ReplaceCvTacticalAI_PlotAlreadyTargeted(int (*original)(CvTacticalAI*, CvPlot*), CvTacticalAI* self, CvPlot* pPlot);CivRegisterBefore<CivHooks::CvTacticalAI_PlotAlreadyTargeted>(host, &BeforeCvTacticalAI_PlotAlreadyTargeted);CivRegisterAfter<CivHooks::CvTacticalAI_PlotAlreadyTargeted>(host, &AfterCvTacticalAI_PlotAlreadyTargeted);CivRegisterReplace<CivHooks::CvTacticalAI_PlotAlreadyTargeted>(host, &ReplaceCvTacticalAI_PlotAlreadyTargeted);

Code

777/// Do we already have a queued attack running on this plot? Return series ID if yes, -1 if no.778int CvTacticalAI::PlotAlreadyTargeted(CvPlot* pPlot)779{780	if(m_QueuedAttacks.size() > 0)781	{782		std::list<CvQueuedAttack>::iterator it;783		for(it = m_QueuedAttacks.begin(); it != m_QueuedAttacks.end(); it++)784		{785			if(it->GetTarget()->GetTargetX() == pPlot->getX() &&786			        it->GetTarget()->GetTargetY() == pPlot->getY())787			{788				return it->GetSeriesID();789			}790		}791	}792	return -1;793}

Calls

Called by