fix projectiles not rendering on mods based on ddnet

for some reason the client doesnt render extrainfo projectiles if the gamemode wasnt ddnet
This commit is contained in:
ZombieToad 2018-07-04 04:19:36 +01:00
parent af2d86765c
commit 5e723f6199
4 changed files with 6 additions and 8 deletions

View file

@ -73,9 +73,7 @@ void CItems::RenderProjectile(const CNetObj_Projectile *pCurrent, int ItemID)
vec2 StartPos;
vec2 StartVel;
CServerInfo Info;
Client()->GetServerInfo(&Info);
ExtractInfo(pCurrent, &StartPos, &StartVel, IsDDNet(&Info));
ExtractInfo(pCurrent, &StartPos, &StartVel);
vec2 Pos = CalcPos(StartPos, StartVel, Curvature, Speed, Ct);
vec2 PrevPos = CalcPos(StartPos, StartVel, Curvature, Speed, Ct-0.001f);

View file

@ -716,7 +716,7 @@ void CGameClient::OnMessage(int MsgId, CUnpacker *pUnpacker, bool IsDummy)
{
vec2 StartPos;
vec2 Direction;
ExtractInfo(&Proj, &StartPos, &Direction, 1);
ExtractInfo(&Proj, &StartPos, &Direction);
if(CWeaponData *pCurrentData = GetWeaponData(Proj.m_StartTick))
{
if(CWeaponData *pMatchingData = FindWeaponData(Proj.m_StartTick))
@ -2098,7 +2098,7 @@ void CLocalProjectile::Init(CGameClient *pGameClient, CWorldCore *pWorld, CColli
m_Type = pProj->m_Type;
m_Weapon = m_Type;
ExtractInfo(pProj, &m_Pos, &m_Direction, 1);
ExtractInfo(pProj, &m_Pos, &m_Direction);
if(UseExtraInfo(pProj))
{

View file

@ -12,9 +12,9 @@ bool UseExtraInfo(const CNetObj_Projectile *pProj)
return ExtraInfoFlag;
}
void ExtractInfo(const CNetObj_Projectile *pProj, vec2 *StartPos, vec2 *StartVel, bool IsDDNet)
void ExtractInfo(const CNetObj_Projectile *pProj, vec2 *StartPos, vec2 *StartVel)
{
if(!UseExtraInfo(pProj) || !IsDDNet)
if(!UseExtraInfo(pProj))
{
StartPos->x = pProj->m_X;
StartPos->y = pProj->m_Y;

View file

@ -6,7 +6,7 @@
#include <base/vmath.h>
bool UseExtraInfo(const CNetObj_Projectile *pProj);
void ExtractInfo(const CNetObj_Projectile *pProj, vec2 *StartPos, vec2 *StartVel, bool IsDDNet);
void ExtractInfo(const CNetObj_Projectile *pProj, vec2 *StartPos, vec2 *StartVel);
void ExtractExtraInfo(const CNetObj_Projectile *pProj, int *Owner, bool *Explosive, int *Bouncing, bool *Freeze);
void SnapshotRemoveExtraInfo(unsigned char *pData);