mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
fixed graphic problems with ninja when pausing a demo. Closes #269
This commit is contained in:
parent
e46cb02089
commit
9ff7500f30
|
@ -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;
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue