fixed graphic problems with ninja when pausing a demo. Closes #269

This commit is contained in:
oy 2010-11-17 00:38:20 +01:00
parent e46cb02089
commit 9ff7500f30
2 changed files with 18 additions and 2 deletions

View file

@ -35,6 +35,13 @@ void CParticles::OnReset()
void CParticles::Add(int Group, CParticle *pPart)
{
if(Client()->State() == IClient::STATE_DEMOPLAYBACK)
{
const IDemoPlayer::CInfo *pInfo = DemoPlayer()->BaseInfo();
if(pInfo->m_Paused)
return;
}
if (m_FirstFree == -1)
return;

View file

@ -1,3 +1,4 @@
#include <engine/demo.h>
#include <engine/graphics.h>
#include <engine/shared/config.h>
#include <game/generated/protocol.h>
@ -417,8 +418,16 @@ void CPlayers::RenderPlayer(
if ((Client()->GameTick()-Player.m_AttackTick) <= (SERVER_TICK_SPEED / 6) && g_pData->m_Weapons.m_aId[iw].m_NumSpriteMuzzles)
{
int IteX = rand() % g_pData->m_Weapons.m_aId[iw].m_NumSpriteMuzzles;
float Alpha = 1.0f;
if (Alpha > 0.0f && g_pData->m_Weapons.m_aId[iw].m_aSpriteMuzzles[IteX])
if(Client()->State() == IClient::STATE_DEMOPLAYBACK)
{
static int s_LastIteX = IteX;
const IDemoPlayer::CInfo *pInfo = DemoPlayer()->BaseInfo();
if(pInfo->m_Paused)
IteX = s_LastIteX;
else
s_LastIteX = IteX;
}
if(g_pData->m_Weapons.m_aId[iw].m_aSpriteMuzzles[IteX])
{
vec2 Dir = vec2(pPlayerChar->m_X,pPlayerChar->m_Y) - vec2(pPrevChar->m_X, pPrevChar->m_Y);
Dir = normalize(Dir);