Re: [Snippet] Fix sniper right click shit
Untested, but this should work without having FPS drops.
Code:
unsigned long g_dwLastSniperUpdate = 0;
void ZMyCharacter::OnGadget_Snifer()
{
ZMyCharaterStatusBitPacking & zStatus = m_statusFlags.Ref();
zStatus.m_bSniferMode = !zStatus.m_bSniferMode;
ZCombatInterface* ci=ZGetCombatInterface();
unsigned long dwTime = timeGetTime();
if (ci && (g_dwLastSniperUpdate == 0 || g_dwLastSniperUpdate <= (dwTime - 100)))
{
if (zStatus.m_bSniferMode)
{
ci->OnGadget(MWT_SNIFER);
ZGetGameInterface()->GetCamera()->m_fDist = 0.0f;
}
else
{
ci->OnGadgetOff();
ZGetGameInterface()->GetCamera()->m_fDist = 290.0f;
}
g_dwLastSniperUpdate = dwTime;
}
}
Re: [Snippet] Fix sniper right click shit
Re: [Snippet] Fix sniper right click shit
but that slowing the game else i will try delaying for the code
Re: [Snippet] Fix sniper right click shit
Re: [Snippet] Fix sniper right click shit
Quote:
Originally Posted by
medotarek
but that slowing the game else i will try delaying for the code
Wizkids snippet does not slow your game.
Re: [Snippet] Fix sniper right click shit
Quote:
Originally Posted by
Mr_Troy
Wizkids snippet does not slow your game.
Wizkids edit it but did you check it before? Because i checked it and this is not working good.
Re: [Snippet] Fix sniper right click shit
Quote:
Originally Posted by
Wizkidje
Untested, but this should work without having FPS drops.
Code:
unsigned long g_dwLastSniperUpdate = 0;
void ZMyCharacter::OnGadget_Snifer()
{
ZMyCharaterStatusBitPacking & zStatus = m_statusFlags.Ref();
zStatus.m_bSniferMode = !zStatus.m_bSniferMode;
ZCombatInterface* ci=ZGetCombatInterface();
unsigned long dwTime = timeGetTime();
if (ci && (g_dwLastSniperUpdate == 0 || g_dwLastSniperUpdate <= (dwTime - 100)))
{
if (zStatus.m_bSniferMode)
{
ci->OnGadget(MWT_SNIFER);
ZGetGameInterface()->GetCamera()->m_fDist = 0.0f;
}
else
{
ci->OnGadgetOff();
ZGetGameInterface()->GetCamera()->m_fDist = 290.0f;
}
g_dwLastSniperUpdate = dwTime;
}
}
this solve not correct, but idea better than Sleep.
This correct solve (tested)
Code:
unsigned long g_dwLastSniperUpdate = 0;
void ZMyCharacter::OnGadget_Snifer()
{
unsigned long dwTime = timeGetTime();
if (g_dwLastSniperUpdate == 0 || g_dwLastSniperUpdate <= (dwTime - 200))
{
ZMyCharaterStatusBitPacking & zStatus = m_statusFlags.Ref();
zStatus.m_bSniferMode = !zStatus.m_bSniferMode;
ZCombatInterface* ci=ZGetCombatInterface();
if (ci)
{
if (zStatus.m_bSniferMode)
{
ci->OnGadget(MWT_SNIFER);
}
else
{
ci->OnGadgetOff();
}
}
g_dwLastSniperUpdate = dwTime;
}
}