@@ -22,21 +22,24 @@ void CItems::RenderProjectile(const CNetObj_Projectile *pCurrent, int ItemID)
2222 // get positions
2323 float Curvature = 0 ;
2424 float Speed = 0 ;
25- if (pCurrent->m_Type == WEAPON_GRENADE)
25+
26+ int WeaponPredict = pCurrent->m_Type >= NUM_WEAPONS ? m_pClient->m_pResources ->GetWeaponResourcePredictsLike (pCurrent->m_Type ) : pCurrent->m_Type ;
27+ if (WeaponPredict == WEAPON_GRENADE)
2628 {
2729 Curvature = m_pClient->m_Tuning .m_GrenadeCurvature ;
2830 Speed = m_pClient->m_Tuning .m_GrenadeSpeed ;
2931 }
30- else if (pCurrent-> m_Type == WEAPON_SHOTGUN)
32+ else if (WeaponPredict == WEAPON_SHOTGUN)
3133 {
3234 Curvature = m_pClient->m_Tuning .m_ShotgunCurvature ;
3335 Speed = m_pClient->m_Tuning .m_ShotgunSpeed ;
3436 }
35- else if (pCurrent-> m_Type == WEAPON_GUN)
37+ else if (WeaponPredict == WEAPON_GUN)
3638 {
3739 Curvature = m_pClient->m_Tuning .m_GunCurvature ;
3840 Speed = m_pClient->m_Tuning .m_GunSpeed ;
3941 }
42+
4043
4144 static float s_LastGameTickTime = Client ()->GameTickTime ();
4245 if (!m_pClient->IsWorldPaused () && !m_pClient->IsDemoPlaybackPaused ())
@@ -75,14 +78,20 @@ void CItems::RenderProjectile(const CNetObj_Projectile *pCurrent, int ItemID)
7578 vec2 Pos = CalcPos (StartPos, StartVel, Curvature, Speed, Ct);
7679 vec2 PrevPos = CalcPos (StartPos, StartVel, Curvature, Speed, Ct-0 .001f );
7780
78- Graphics ()->TextureSet (g_pData->m_aImages [IMAGE_GAME].m_Id );
81+ if (pCurrent->m_Type >= NUM_WEAPONS)
82+ Graphics ()->TextureSet (m_pClient->m_pResources ->GetWeaponResourceProjectile (pCurrent->m_Type )->m_Texture );
83+ else
84+ Graphics ()->TextureSet (g_pData->m_aImages [IMAGE_GAME].m_Id );
7985 Graphics ()->QuadsBegin ();
8086
81- RenderTools ()->SelectSprite (g_pData->m_Weapons .m_aId [clamp (pCurrent->m_Type , 0 , NUM_WEAPONS-1 )].m_pSpriteProj );
87+ if (pCurrent->m_Type < NUM_WEAPONS)
88+ RenderTools ()->SelectSprite (g_pData->m_Weapons .m_aId [clamp (pCurrent->m_Type , 0 , NUM_WEAPONS-1 )].m_pSpriteProj );
89+
8290 const vec2 Vel = Pos-PrevPos;
8391
8492 // add particle for this projectile
85- if (pCurrent->m_Type == WEAPON_GRENADE)
93+ int WeaponLooks = pCurrent->m_Type >= NUM_WEAPONS ? m_pClient->m_pResources ->GetWeaponResourceLooksLike (pCurrent->m_Type ) : pCurrent->m_Type ;
94+ if (WeaponLooks == WEAPON_GRENADE)
8695 {
8796 m_pClient->m_pEffects ->SmokeTrail (Pos, Vel*-1 );
8897 const float Now = Client ()->LocalTime ();
@@ -98,7 +107,8 @@ void CItems::RenderProjectile(const CNetObj_Projectile *pCurrent, int ItemID)
98107 Graphics ()->QuadsSetRotation (length (Vel) > 0 .00001f ? angle (Vel) : 0 );
99108 }
100109
101- IGraphics::CQuadItem QuadItem (Pos.x , Pos.y , 32 , 32 );
110+ const int Size = pCurrent->m_Type >= NUM_WEAPONS ? 64 : 32 ;
111+ IGraphics::CQuadItem QuadItem (Pos.x , Pos.y , Size, Size);
102112 Graphics ()->QuadsDraw (&QuadItem, 1 );
103113 Graphics ()->QuadsSetRotation (0 );
104114 Graphics ()->QuadsEnd ();
0 commit comments