//------------------------------------------------------------------------ int CScriptBind_Action::SetAimQueryMode(IFunctionHandler* pH, ScriptHandle entityId, int mode) { IEntity* entity = gEnv->pEntitySystem->GetEntity(static_cast<EntityId>(entityId.n)); IAIObject* ai = entity ? entity->GetAI() : NULL; CAIProxy* proxy = ai ? static_cast<CAIProxy*>(ai->GetProxy()) : NULL; if (proxy) proxy->SetAimQueryMode(static_cast<CAIProxy::AimQueryMode>(mode)); return pH->EndFunction(); }
// Description: // // Arguments: // // Return: // void CPersonalSignalTimer::SetListener(bool bAdd) { IEntity *pEntity = GetEntity();; if (pEntity) { IAIObject *pAIObject = pEntity->GetAI(); if (pAIObject) { CAIProxy* pAIProxy = (CAIProxy*)pAIObject->GetProxy(); if (pAIProxy) { if (bAdd) pAIProxy->AddListener(this); else pAIProxy->RemoveListener(this); } } } }