mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Fix: Don't autoswitch weapons on (dd)race(network) servers (fixes #57)
This commit is contained in:
parent
9453b80e66
commit
71eb763e53
|
@ -436,7 +436,12 @@ void CControls::OnRender()
|
|||
}
|
||||
}
|
||||
|
||||
if( g_Config.m_ClAutoswitchWeaponsOutOfAmmo && m_pClient->m_Snap.m_pLocalCharacter )
|
||||
CServerInfo Info;
|
||||
GameClient()->Client()->GetServerInfo(&Info);
|
||||
bool IsGameTypeRace = str_find_nocase(Info.m_aGameType, "race") || str_find_nocase(Info.m_aGameType, "fastcap");
|
||||
bool IsGameTypeDDRace = str_find_nocase(Info.m_aGameType, "ddrace") || str_find_nocase(Info.m_aGameType, "mkrace");
|
||||
|
||||
if( g_Config.m_ClAutoswitchWeaponsOutOfAmmo && !IsGameTypeRace && !IsGameTypeDDRace && m_pClient->m_Snap.m_pLocalCharacter )
|
||||
{
|
||||
// Keep track of ammo count, we know weapon ammo only when we switch to that weapon, this is tracked on server and protocol does not track that
|
||||
m_AmmoCount[m_pClient->m_Snap.m_pLocalCharacter->m_Weapon%NUM_WEAPONS] = m_pClient->m_Snap.m_pLocalCharacter->m_AmmoCount;
|
||||
|
|
Loading…
Reference in a new issue