Пример #1
0
//------------------------------------------------------------------------
int CScriptBind_Item::GetOwnerId(IFunctionHandler *pH)
{
	CItem *pItem = GetItem(pH);
	if (!pItem)
		return pH->EndFunction();

	return pH->EndFunction(ScriptHandle(pItem->GetOwnerId()));
}
Пример #2
0
//------------------------------------------------------------------
void CLam::UpdateAILightAndLaser(const Vec3& pos, const Vec3& dir, float lightRange, float fov, float laserRange)
{
    if (!gEnv->pAISystem)
        return;

    EntityId userId = 0;
    if (IItem *pOwnerItem = m_pItemSystem->GetItem(GetParentId()))
    {
        CItem* pParentItem = (CItem *)pOwnerItem;
        userId = pParentItem->GetOwnerId();
    }

    if (lightRange > 0.0001f)
    {
        gEnv->pAISystem->DynSpotLightEvent(pos, dir, lightRange, DEG2RAD(fov)/2, AILE_FLASH_LIGHT, userId, 1.0f);
        gEnv->pAISystem->DynOmniLightEvent(pos - dir*0.5f, 1.5f, AILE_FLASH_LIGHT, userId, 2.0f);
    }

    // [Mikko] 4.10.2007 Removed as per design request.
    /*	if (laserRange > 0.0001f)
    	{
    		gEnv->pAISystem->DynSpotLightEvent(pos, dir, max(0.0f, laserRange - 0.1f), DEG2RAD(0.25f), AILE_LASER, pUserAI, 2.0f);
    	}*/
}