//------------------------------------------------------------------------
void CGameRulesKingOfTheHillObjective::UpdateIcon(SHoldEntityDetails * pDetails)
{
	SKotHEntity *pKotHEntity = static_cast<SKotHEntity *>(pDetails->m_pAdditionalData);
	CRY_ASSERT(pKotHEntity);

	const char *pName = NULL;
	const char *pColour = NULL;
	EGameRulesMissionObjectives requestedIcon = GetIcon(pDetails, &pName, &pColour);

	if (requestedIcon != EGRMO_Unknown)
	{
		CCCPOINT(KingOfTheHillObjective_SetNewIcon);

		SHUDEventWrapper::OnNewObjective(pDetails->m_id, requestedIcon, 0.f, 0, pName, pColour);

		pKotHEntity->m_needsIconUpdate = false;

		if(!pKotHEntity->m_isOnRadar)
		{
			SHUDEvent hudevent(eHUDEvent_AddEntity);
			hudevent.AddData(SHUDEventData((int)pDetails->m_id));
			CHUDEventDispatcher::CallEvent(hudevent);
			pKotHEntity->m_isOnRadar = true;
		}
	}
	else if (pKotHEntity->m_currentIcon != EGRMO_Unknown)
	{
		CCCPOINT(KingOfTheHillObjective_RemoveIcon);

		SHUDEventWrapper::OnRemoveObjective(pDetails->m_id, 0);
	}

	pKotHEntity->m_currentIcon = requestedIcon;
}
//------------------------------------------------------------------------
void CGameRulesKingOfTheHillObjective::OnRemoveHoldEntity( SHoldEntityDetails *pDetails )
{
	ClearEntityAudio(pDetails);

	SHUDEventWrapper::OnRemoveObjective(pDetails->m_id, 0);

	SHUDEvent hudevent(eHUDEvent_RemoveEntity);
	hudevent.AddData(SHUDEventData((int)pDetails->m_id));
	CHUDEventDispatcher::CallEvent(hudevent);
}
void CTacticalManager::PostSerialize()
{
	// Radar needs player client entity to be set otherwise edge entity items won't show
	// ENTITY_EVENT_UNHIDE isn't called when loading, since state is already unhided, that usually triggers CActor::ProcessEvent with event type ENTITY_EVENT_UNHIDE
	// Call the hud event here instead
	const EntityId playerEntityID = gEnv->pGame->GetIGameFramework()->GetClientActorId();
	AddEntity(playerEntityID, CTacticalManager::eTacticalEntity_Unit);
	SHUDEvent hudevent(eHUDEvent_AddEntity);
	hudevent.AddData(SHUDEventData((int)playerEntityID));
	CHUDEventDispatcher::CallEvent(hudevent);
}