Browse Source

Fix some warnings.

aghl
Night Owl 8 years ago
parent
commit
a35e7b5068
  1. 4
      cl_dll/aghl/aghudlocation.cpp
  2. 2
      cl_dll/aghl/agmatchreport.cpp
  3. 4
      cl_dll/aghl/agminidump.cpp
  4. 4
      cl_dll/aghl/agmodelcheck.h
  5. 2
      dlls/aghl/agarena.cpp
  6. 8
      dlls/aghl/agclient.cpp
  7. 4
      dlls/aghl/agctf.cpp
  8. 4
      dlls/aghl/aggamemode.cpp
  9. 2
      dlls/aghl/aggamerules.cpp
  10. 4
      dlls/aghl/agglobal.cpp
  11. 2
      dlls/aghl/agmatch.cpp
  12. 4
      dlls/aghl/agsettings.cpp
  13. 6
      dlls/aghl/agvote.cpp
  14. 12
      dlls/player.cpp

4
cl_dll/aghl/aghudlocation.cpp

@ -27,7 +27,7 @@ int AgHudLocation::Init(void) @@ -27,7 +27,7 @@ int AgHudLocation::Init(void)
m_iFlags = 0;
m_szMap[0] = '\0';
for (int i = 1; i <= MAX_PLAYERS; i++)
for (int i = 1; i < MAX_PLAYERS + 1; i++)
vPlayerLocations[i] = Vector(0,0,0);
gHUD.AddHudElem(this);
@ -366,7 +366,7 @@ void AgHudLocation::ParseAndEditSayString(char* pszSay, int iPlayer) @@ -366,7 +366,7 @@ void AgHudLocation::ParseAndEditSayString(char* pszSay, int iPlayer)
if ('l' == *pszSayTemp || 'L' == *pszSayTemp || 'd' == *pszSayTemp || 'D' == *pszSayTemp )
{
//Location files.
pszSay = pszSay + sprintf(pszSay,Location(vPlayerLocations[iPlayer]).c_str());
pszSay = pszSay + sprintf(pszSay, "%s", Location(vPlayerLocations[iPlayer]).c_str());
pszSayTemp++;
continue;
}

2
cl_dll/aghl/agmatchreport.cpp

@ -54,7 +54,7 @@ void AgMatchReport::Save() @@ -54,7 +54,7 @@ void AgMatchReport::Save()
//Print the players for that one.
for (int iPlayer = 1; iPlayer <= gEngfuncs.GetMaxClients(); iPlayer++)
{
if (g_PlayerExtraInfo[iPlayer].teamname && g_PlayerInfoList[iPlayer].name && 0 == stricmp(g_PlayerExtraInfo[iPlayer].teamname,g_TeamInfo[i].name))
if( ( ( g_PlayerExtraInfo[iPlayer].teamname && g_PlayerInfoList[iPlayer].name && 0 == stricmp( g_PlayerExtraInfo[iPlayer].teamname,g_TeamInfo[i].name ) ) ) )
{
fprintf(pFile,"%-20s\t%d\t%d\t%d\t%d\t%s\r\n",(const char*)g_PlayerInfoList[iPlayer].name,g_PlayerExtraInfo[iPlayer].frags,g_PlayerExtraInfo[iPlayer].deaths,g_PlayerInfoList[iPlayer].ping,g_PlayerInfoList[iPlayer].packetloss,AgGetAuthID(iPlayer).c_str());
}

4
cl_dll/aghl/agminidump.cpp

@ -145,7 +145,7 @@ public: @@ -145,7 +145,7 @@ public:
AgMiniDump g_MiniDump; //The dumper.
#endif CLIENT_DLL
#endif //CLIENT_DLL
#endif AG_USE_MINIDUMP
#endif //AG_USE_MINIDUMP
//-- Martin Webrant

4
cl_dll/aghl/agmodelcheck.h

@ -7,8 +7,8 @@ @@ -7,8 +7,8 @@
#pragma once
#endif // _MSC_VER > 1000
#include "AgGlobal.h"
#include "AgModel.h"
#include "agglobal.h"
#include "agmodel.h"
#ifdef AG_USE_CHEATPROTECTION

2
dlls/aghl/agarena.cpp

@ -43,7 +43,7 @@ void AgArena::Think() @@ -43,7 +43,7 @@ void AgArena::Think()
CBasePlayer* pPlayer1 = GetPlayer1();
CBasePlayer* pPlayer2 = GetPlayer2();
if (!pPlayer1 || pPlayer1 && !pPlayer1->IsAlive() || !pPlayer2 || pPlayer2 && !pPlayer2->IsAlive())
if( !pPlayer1 || ( pPlayer1 && !pPlayer1->IsAlive() ) || !pPlayer2 || ( pPlayer2 && !pPlayer2->IsAlive() ) )
{
m_Status = PlayerDied;
m_fNextCountdown = gpGlobals->time + 3.0; //Let the effect of him dying play for 3 seconds

8
dlls/aghl/agclient.cpp

@ -108,7 +108,7 @@ bool AgClient::HandleCommand(CBasePlayer* pPlayer) @@ -108,7 +108,7 @@ bool AgClient::HandleCommand(CBasePlayer* pPlayer)
//Dont spectate if player is in game in arena.
//Use sound and text flood checks, We dont want lamers to change to often.
if (pPlayer->IsIngame() && ARENA == AgGametype() || pPlayer->FloodCheck() || pPlayer->FloodSound())
if( ( pPlayer->IsIngame() && ARENA == AgGametype() ) || pPlayer->FloodCheck() || pPlayer->FloodSound())
return true;
if (2 == CMD_ARGC() && 1 == atoi(CMD_ARGV(1)))
@ -430,7 +430,7 @@ void AgClient::Say(CBasePlayer* pPlayer, say_type Type ) @@ -430,7 +430,7 @@ void AgClient::Say(CBasePlayer* pPlayer, say_type Type )
return;
//Check if the user is flooding us with nonsens.
if ((All == Type || pPlayer->IsSpectator()) && pPlayer->FloodCheck() || pPlayer->FloodText())
if( ( ( All == Type || pPlayer->IsSpectator() ) && pPlayer->FloodCheck() ) || pPlayer->FloodText())
return;
bool bSendLocation = false;
@ -564,10 +564,12 @@ void AgClient::Say(CBasePlayer* pPlayer, say_type Type ) @@ -564,10 +564,12 @@ void AgClient::Say(CBasePlayer* pPlayer, say_type Type )
{
//Flag info
if (pPlayer && pPlayer->IsAlive() && !pPlayer->IsSpectator())
{
if (pPlayer->m_bFlagTeam1)
pText = pText + sprintf(pText,CTF_TEAM1_NAME);
else if (pPlayer->m_bFlagTeam2)
pText = pText + sprintf(pText,CTF_TEAM2_NAME);
}
pSayText++;
continue;
}
@ -761,7 +763,7 @@ void AgClient::Say(CBasePlayer* pPlayer, say_type Type ) @@ -761,7 +763,7 @@ void AgClient::Say(CBasePlayer* pPlayer, say_type Type )
void AgClient::Play(CBasePlayer* pPlayer, say_type Type, const char* pszWave)
{
//Check for flooding if spectator
if (pPlayer->IsSpectator() && pPlayer->FloodCheck() || !g_pGameRules->IsTeamplay() || pPlayer->FloodSound())
if( ( pPlayer->IsSpectator() && pPlayer->FloodCheck() ) || !g_pGameRules->IsTeamplay() || pPlayer->FloodSound())
return;
//Play sound to teammates.

4
dlls/aghl/agctf.cpp

@ -401,8 +401,8 @@ void AgCTF::AddPointsForKill(CBasePlayer *pAttacker, CBasePlayer *pKilled) @@ -401,8 +401,8 @@ void AgCTF::AddPointsForKill(CBasePlayer *pAttacker, CBasePlayer *pKilled)
if ( pAttacker != pKilled && g_pGameRules->PlayerRelationship( pAttacker, pKilled ) == GR_TEAMMATE )
return; //Killed his team m8.
if (FStrEq(CTF_TEAM1_NAME, pKilled->m_szTeamName) && pKilled->m_bFlagTeam2
||FStrEq(CTF_TEAM2_NAME, pKilled->m_szTeamName) && pKilled->m_bFlagTeam1)
if( ( FStrEq(CTF_TEAM1_NAME, pKilled->m_szTeamName) && pKilled->m_bFlagTeam2 )
|| ( FStrEq(CTF_TEAM2_NAME, pKilled->m_szTeamName) && pKilled->m_bFlagTeam1 ) )
{
//He killed the flag carrier.
pAttacker->AddPoints(ag_ctf_carrierkillpoints.value, TRUE);

4
dlls/aghl/aggamemode.cpp

@ -108,7 +108,7 @@ bool AgGameMode::HandleCommand(CBasePlayer* pPlayer) @@ -108,7 +108,7 @@ bool AgGameMode::HandleCommand(CBasePlayer* pPlayer)
return true;
}
if (!IsAllowedGamemode(CMD_ARGV(0)),pPlayer)
if (!IsAllowedGamemode(CMD_ARGV(0)))
return false;
Gamemode(CMD_ARGV(0),pPlayer);
@ -118,7 +118,7 @@ bool AgGameMode::HandleCommand(CBasePlayer* pPlayer) @@ -118,7 +118,7 @@ bool AgGameMode::HandleCommand(CBasePlayer* pPlayer)
{
if (FStrEq(CMD_ARGV(0), "agnextmode"))
{
if (!IsAllowedGamemode(CMD_ARGV(1)),pPlayer)
if (!IsAllowedGamemode(CMD_ARGV(1)))
return false;
NextGamemode(CMD_ARGV(1),pPlayer);

2
dlls/aghl/aggamerules.cpp

@ -255,7 +255,7 @@ void AgGameRules::PlayerSpawn(CBasePlayer* pPlayer) @@ -255,7 +255,7 @@ void AgGameRules::PlayerSpawn(CBasePlayer* pPlayer)
addDefault = TRUE;
while ( pWeaponEntity = UTIL_FindEntityByClassname( pWeaponEntity, "game_player_equip" ))
while( ( pWeaponEntity = UTIL_FindEntityByClassname( pWeaponEntity, "game_player_equip" ) ) )
{
pWeaponEntity->Touch( pPlayer );
addDefault = FALSE;

4
dlls/aghl/agglobal.cpp

@ -452,8 +452,8 @@ CBasePlayer* AgPlayerByName(const AgString& sNameOrPlayerNumber) @@ -452,8 +452,8 @@ CBasePlayer* AgPlayerByName(const AgString& sNameOrPlayerNumber)
CBasePlayer* pPlayerLoop = AgPlayerByIndex(i);
if (pPlayerLoop)
if ( 0 == stricmp(pPlayerLoop->GetName(),sNameOrPlayerNumber.c_str()) ||
"#" == sNameOrPlayerNumber.substr(0,1) &&
GETPLAYERUSERID(pPlayerLoop->edict()) == atoi(sNameOrPlayerNumber.substr(1).c_str())
( "#" == sNameOrPlayerNumber.substr(0,1) &&
GETPLAYERUSERID(pPlayerLoop->edict()) == atoi(sNameOrPlayerNumber.substr(1).c_str() ) )
)
return pPlayerLoop;
}

2
dlls/aghl/agmatch.cpp

@ -92,7 +92,7 @@ void AgMatch::Think() @@ -92,7 +92,7 @@ void AgMatch::Think()
void AgMatch::Start(const AgString& sSpawn)
{
if (m_fMatchStart > 0 || 0 == timelimit.value && 0 == fraglimit.value)
if( m_fMatchStart > 0 || ( 0 == timelimit.value && 0 == fraglimit.value ) )
return;
//Count players

4
dlls/aghl/agsettings.cpp

@ -74,9 +74,9 @@ bool AgSettings::Think() @@ -74,9 +74,9 @@ bool AgSettings::Think()
m_fNextCheck = gpGlobals->time + 5.0; //Every 5 seconds.
//Check if to display next map.
if (m_bCheckNextMap && timelimit.value || m_bCheckNextMap && fraglimit.value)
if( ( m_bCheckNextMap && timelimit.value ) || ( m_bCheckNextMap && fraglimit.value ) )
{
if (timeleft.value && 60 > timeleft.value || fraglimit.value && 2 > fragsleft.value)
if( ( timeleft.value && 60 > timeleft.value ) || ( fraglimit.value && 2 > fragsleft.value ) )
{
#ifdef AG_NO_CLIENT_DLL
AgSay(NULL,UTIL_VarArgs("Next map is %s\n",GetNextLevel().c_str()),NULL,30,0.03,0.05,2);

6
dlls/aghl/agvote.cpp

@ -250,9 +250,9 @@ bool AgVote::HandleCommand(CBasePlayer* pPlayer) @@ -250,9 +250,9 @@ bool AgVote::HandleCommand(CBasePlayer* pPlayer)
FStrEq(m_sVote.c_str(),"agkick") ||
FStrEq(m_sVote.c_str(),"agadmin") )
{
if (FStrEq(m_sVote.c_str(),"agkick") && 1 > ag_vote_kick.value
||FStrEq(m_sVote.c_str(),"agadmin") && 1 > ag_vote_admin.value
||FStrEq(m_sVote.c_str(),"agallow") && 1 > ag_vote_allow.value
if( ( FStrEq(m_sVote.c_str(),"agkick") && 1 > ag_vote_kick.value )
|| ( FStrEq(m_sVote.c_str(),"agadmin") && 1 > ag_vote_admin.value )
|| ( FStrEq(m_sVote.c_str(),"agallow") && 1 > ag_vote_allow.value )
)
{
AgConsole("Vote is not allowed by server admin.",pPlayer);

12
dlls/player.cpp

@ -2642,7 +2642,7 @@ void CBasePlayer::PostThink() @@ -2642,7 +2642,7 @@ void CBasePlayer::PostThink()
// Track button info so we can detect 'pressed' and 'released' buttons next frame
//m_afButtonLast = pev->button;
//Remove observe mode if using attack or use.
if( ( pev->button & IN_ATTACK ) && ( pev->effects == EF_NODRAW ) || ( pev->button & IN_USE ) && ( pev->effects == EF_NODRAW ) )
if( ( ( pev->button & IN_ATTACK ) && ( pev->effects == EF_NODRAW ) ) || ( ( pev->button & IN_USE ) && ( pev->effects == EF_NODRAW ) ) )
{
if( DEAD_NO == pev->deadflag || DEAD_RESPAWNABLE == pev->deadflag)
{
@ -3248,7 +3248,7 @@ const char *CBasePlayer::TeamID( void ) @@ -3248,7 +3248,7 @@ const char *CBasePlayer::TeamID( void )
return "";
//++ BulliT
if( IsSpectator() && ( LMS != AgGametype() || LMS == AgGametype() && !m_bReady ) )
if( IsSpectator() && ( LMS != AgGametype() || ( LMS == AgGametype() && !m_bReady ) ) )
return "";
//-- Martin Webrant
@ -4357,8 +4357,8 @@ void CBasePlayer::UpdateClientData( void ) @@ -4357,8 +4357,8 @@ void CBasePlayer::UpdateClientData( void )
for( int i=0; i < MAX_AMMO_SLOTS; i++ )
{
if( m_pClientActiveItem && i == m_pClientActiveItem->PrimaryAmmoIndex()
|| m_pClientActiveItem && i == m_pClientActiveItem->SecondaryAmmoIndex() )
if( ( m_pClientActiveItem && i == m_pClientActiveItem->PrimaryAmmoIndex() )
|| ( m_pClientActiveItem && i == m_pClientActiveItem->SecondaryAmmoIndex() ) )
{
// this is the primary or secondary ammo type for the active weapon so lets update the client with the info if needed.
if( pPlayerTarget->m_rgAmmo[i] != m_rgAmmoLast[i] )
@ -5476,8 +5476,8 @@ void CBasePlayer::UpdateFlagStatus( CBasePlayer *pPlayer ) @@ -5476,8 +5476,8 @@ void CBasePlayer::UpdateFlagStatus( CBasePlayer *pPlayer )
else
iFlagStatus2 = Home;
if( m_iFlagStatus1Last == Carry && ( iFlagStatus1 != Carry )
||m_iFlagStatus2Last == Carry && ( iFlagStatus2 != Carry ) )
if( ( m_iFlagStatus1Last == Carry && ( iFlagStatus1 != Carry ) )
|| ( m_iFlagStatus2Last == Carry && ( iFlagStatus2 != Carry ) ) )
{
//Turn off rendering since we cont carry it anymore.
pev->renderfx = kRenderFxNone;

Loading…
Cancel
Save