Bazaar developer reference

CvPlayer::removeFromArmy(int)

Defined in
CvPlayer.cpp, line 21394
Class
CvPlayer
Hook name
CivHooks::CvPlayer_removeFromArmy_with_int

Hooks

static bool BeforeCvPlayer_removeFromArmy_with_int(CvPlayer* self, int iID, bool& result);static void AfterCvPlayer_removeFromArmy_with_int(CvPlayer* self, int iID, bool& result);static bool ReplaceCvPlayer_removeFromArmy_with_int(bool (*original)(CvPlayer*, int), CvPlayer* self, int iID);CivRegisterBefore<CivHooks::CvPlayer_removeFromArmy_with_int>(host, &BeforeCvPlayer_removeFromArmy_with_int);CivRegisterAfter<CivHooks::CvPlayer_removeFromArmy_with_int>(host, &AfterCvPlayer_removeFromArmy_with_int);CivRegisterReplace<CivHooks::CvPlayer_removeFromArmy_with_int>(host, &ReplaceCvPlayer_removeFromArmy_with_int);

Code

21394bool CvPlayer::removeFromArmy(int iID)21395{21396	CvArmyAI* pLoopArmyAI;21397	int iLoop;21398	bool bRemoved = false;2139921400	// for all the army AIs21401	for(pLoopArmyAI = firstArmyAI(&iLoop); pLoopArmyAI != NULL && !bRemoved; pLoopArmyAI = nextArmyAI(&iLoop))21402	{21403		// attempt to remove from this army21404		bRemoved = removeFromArmy(pLoopArmyAI->GetID(), iID);21405	}21406	return bRemoved;21407}

Calls