Skip to content

Commit

Permalink
Make the client able to have tee's without weapons
Browse files Browse the repository at this point in the history
  • Loading branch information
oy committed Feb 17, 2022
1 parent 0a02e13 commit c579bc1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion datasrc/network.py
Expand Up @@ -179,7 +179,7 @@
NetIntRange("m_Health", 0, 10),
NetIntRange("m_Armor", 0, 10),
NetIntAny("m_AmmoCount"),
NetIntRange("m_Weapon", 0, 'NUM_WEAPONS-1'),
NetIntRange("m_Weapon", -1, 'NUM_WEAPONS-1'),
NetEnum("m_Emote", Emotes),
NetTick("m_AttackTick"),
NetFlag("m_TriggeredEvents", CoreEventFlags),
Expand Down
4 changes: 2 additions & 2 deletions src/game/client/components/hud.cpp
Expand Up @@ -632,7 +632,7 @@ void CHud::RenderCursor()
Graphics()->QuadsBegin();

// render cursor
RenderTools()->SelectSprite(g_pData->m_Weapons.m_aId[m_pClient->m_Snap.m_pLocalCharacter->m_Weapon%NUM_WEAPONS].m_pSpriteCursor);
RenderTools()->SelectSprite(g_pData->m_Weapons.m_aId[maximum(0, m_pClient->m_Snap.m_pLocalCharacter->m_Weapon%NUM_WEAPONS)].m_pSpriteCursor);
float CursorSize = 64;
RenderTools()->DrawSprite(m_pClient->m_pControls->m_TargetPos.x, m_pClient->m_pControls->m_TargetPos.y, CursorSize);
Graphics()->QuadsEnd();
Expand Down Expand Up @@ -732,7 +732,7 @@ void CHud::RenderHealthAndAmmo(const CNetObj_Character *pCharacter)
}
else
{
RenderTools()->SelectSprite(g_pData->m_Weapons.m_aId[pCharacter->m_Weapon%NUM_WEAPONS].m_pSpriteProj);
RenderTools()->SelectSprite(g_pData->m_Weapons.m_aId[maximum(0, pCharacter->m_Weapon%NUM_WEAPONS)].m_pSpriteProj);
if(pCharacter->m_Weapon == WEAPON_GRENADE)
{
for(i = 0; i < minimum(pCharacter->m_AmmoCount, 10); i++)
Expand Down
1 change: 1 addition & 0 deletions src/game/client/components/players.cpp
Expand Up @@ -242,6 +242,7 @@ void CPlayers::RenderPlayer(
}

// draw gun
if(Player.m_Weapon >= 0)
{
Graphics()->TextureSet(g_pData->m_aImages[IMAGE_GAME].m_Id);
Graphics()->QuadsBegin();
Expand Down

0 comments on commit c579bc1

Please sign in to comment.