Пример #1
0
//------------------------------------------------------------------------
void CScan::Update(float frameTime, uint32 frameId)
{
	if (m_scanning && m_pWeapon->IsClient())
	{
		if (m_delayTimer>0.0f)
		{
			m_delayTimer -= frameTime;
			if (m_delayTimer>0.0f)
				return;

			m_delayTimer = 0.0f;

			int slot = m_pWeapon->GetStats().fp ?  eIGS_FirstPerson :  eIGS_ThirdPerson;
			int id = m_pWeapon->GetStats().fp ? 0 : 1;

			m_scanLoopId=m_pWeapon->PlayAction(m_scanactions.scan, 0, true, CItem::eIPAF_Default|CItem::eIPAF_CleanBlending);
			ISound *pSound = m_pWeapon->GetSoundProxy()->GetSound(m_scanLoopId);
			if (pSound)
				pSound->GetInterfaceDeprecated()->SetLoopMode(true);
		}

		if(m_delayTimer==0.0f)
		{
			if(m_tagEntitiesDelay>0.0f)
			{
				m_tagEntitiesDelay-=frameTime;
				if(m_tagEntitiesDelay<=0.0f)
				{
					m_tagEntitiesDelay = 0.0f;

					//Here is when entities are displayed on Radar
					if(gEnv->pGame->GetIGameFramework()->GetClientActor() == m_pWeapon->GetOwnerActor())
					{
						if(gEnv->bServer)
							NetShoot(ZERO, 0);
						else
							m_pWeapon->RequestShoot(0, ZERO, ZERO, ZERO, ZERO, 1.0f, 0, false);
					}
				}
			}

			if (m_durationTimer>0.0f)
			{
				m_durationTimer-=frameTime;
				if (m_durationTimer<=0.0f)
				{
					m_durationTimer=0.0f;	
					StopFire();
					//m_pWeapon->RequestShoot(0, ZERO, ZERO, ZERO, ZERO, 1.0f, 0, false);
				}
			}
		}

		m_pWeapon->RequireUpdate(eIUS_FireMode);
	}
}
Пример #2
0
//------------------------------------------------------------------------
void CScan::NetStartFire()
{
	if (!m_pWeapon->IsClient())
		return;

	m_scanLoopId=m_pWeapon->PlayAction(m_scanactions.scan);
	ISound *pSound = m_pWeapon->GetSoundProxy()->GetSound(m_scanLoopId);
	if (pSound)
		pSound->GetInterfaceDeprecated()->SetLoopMode(true);
}