Bazaar developer reference

CvDiplomacyAI::DoCancelHaltDemandProcess()

Defined in
CvDiplomacyAI.cpp, line 4722
Class
CvDiplomacyAI
Hook name
CivHooks::CvDiplomacyAI_DoCancelHaltDemandProcess

Hooks

static bool BeforeCvDiplomacyAI_DoCancelHaltDemandProcess(CvDiplomacyAI* self);static void AfterCvDiplomacyAI_DoCancelHaltDemandProcess(CvDiplomacyAI* self);static void ReplaceCvDiplomacyAI_DoCancelHaltDemandProcess(void (*original)(CvDiplomacyAI*), CvDiplomacyAI* self);CivRegisterBefore<CivHooks::CvDiplomacyAI_DoCancelHaltDemandProcess>(host, &BeforeCvDiplomacyAI_DoCancelHaltDemandProcess);CivRegisterAfter<CivHooks::CvDiplomacyAI_DoCancelHaltDemandProcess>(host, &AfterCvDiplomacyAI_DoCancelHaltDemandProcess);CivRegisterReplace<CivHooks::CvDiplomacyAI_DoCancelHaltDemandProcess>(host, &ReplaceCvDiplomacyAI_DoCancelHaltDemandProcess);

Code

4721/// Stop any current progress towards making a demand4722void CvDiplomacyAI::DoCancelHaltDemandProcess()4723{4724	PlayerTypes eDemandTarget = GetDemandTargetPlayer();47254726	// Are we actually targeting anyone for a demand?4727	if(eDemandTarget != NO_PLAYER)4728	{4729		//CvAssertMsg(GetWarGoal(eDemandTarget) == WAR_GOAL_DEMAND, "DIPLOMACY_AI: AI was preparing to make a demand, but somehow doesn't have an appropriate WarGoal.  Please send Jon this with your last 5 autosaves and what changelist # you're playing.");47304731		if(GetWarGoal(eDemandTarget) == WAR_GOAL_DEMAND)4732		{4733			SetWarGoal(eDemandTarget, NO_WAR_GOAL_TYPE);47344735			// Get rid of the operation to put Units near them4736			CvAIOperation* pOperation = GetPlayer()->GetMilitaryAI()->GetShowOfForceOperation(eDemandTarget);4737			if(pOperation != NULL)4738			{4739				pOperation->Kill(AI_ABORT_DIPLO_OPINION_CHANGE);4740				SetMusteringForAttack(eDemandTarget, false);4741			}4742		}47434744		SetDemandTargetPlayer(NO_PLAYER);4745		SetDemandReady(false);4746	}4747}

Calls

Called by