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

2
cl_dll/aghl/agmatchreport.cpp

@ -54,7 +54,7 @@ void AgMatchReport::Save()
//Print the players for that one. //Print the players for that one.
for (int iPlayer = 1; iPlayer <= gEngfuncs.GetMaxClients(); iPlayer++) 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()); 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:
AgMiniDump g_MiniDump; //The dumper. AgMiniDump g_MiniDump; //The dumper.
#endif CLIENT_DLL #endif //CLIENT_DLL
#endif AG_USE_MINIDUMP #endif //AG_USE_MINIDUMP
//-- Martin Webrant //-- Martin Webrant

4
cl_dll/aghl/agmodelcheck.h

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

2
dlls/aghl/agarena.cpp

@ -43,7 +43,7 @@ void AgArena::Think()
CBasePlayer* pPlayer1 = GetPlayer1(); CBasePlayer* pPlayer1 = GetPlayer1();
CBasePlayer* pPlayer2 = GetPlayer2(); 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_Status = PlayerDied;
m_fNextCountdown = gpGlobals->time + 3.0; //Let the effect of him dying play for 3 seconds 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)
//Dont spectate if player is in game in arena. //Dont spectate if player is in game in arena.
//Use sound and text flood checks, We dont want lamers to change to often. //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; return true;
if (2 == CMD_ARGC() && 1 == atoi(CMD_ARGV(1))) if (2 == CMD_ARGC() && 1 == atoi(CMD_ARGV(1)))
@ -430,7 +430,7 @@ void AgClient::Say(CBasePlayer* pPlayer, say_type Type )
return; return;
//Check if the user is flooding us with nonsens. //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; return;
bool bSendLocation = false; bool bSendLocation = false;
@ -564,10 +564,12 @@ void AgClient::Say(CBasePlayer* pPlayer, say_type Type )
{ {
//Flag info //Flag info
if (pPlayer && pPlayer->IsAlive() && !pPlayer->IsSpectator()) if (pPlayer && pPlayer->IsAlive() && !pPlayer->IsSpectator())
{
if (pPlayer->m_bFlagTeam1) if (pPlayer->m_bFlagTeam1)
pText = pText + sprintf(pText,CTF_TEAM1_NAME); pText = pText + sprintf(pText,CTF_TEAM1_NAME);
else if (pPlayer->m_bFlagTeam2) else if (pPlayer->m_bFlagTeam2)
pText = pText + sprintf(pText,CTF_TEAM2_NAME); pText = pText + sprintf(pText,CTF_TEAM2_NAME);
}
pSayText++; pSayText++;
continue; continue;
} }
@ -761,7 +763,7 @@ void AgClient::Say(CBasePlayer* pPlayer, say_type Type )
void AgClient::Play(CBasePlayer* pPlayer, say_type Type, const char* pszWave) void AgClient::Play(CBasePlayer* pPlayer, say_type Type, const char* pszWave)
{ {
//Check for flooding if spectator //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; return;
//Play sound to teammates. //Play sound to teammates.

4
dlls/aghl/agctf.cpp

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

4
dlls/aghl/aggamemode.cpp

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

2
dlls/aghl/aggamerules.cpp

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

4
dlls/aghl/agglobal.cpp

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

2
dlls/aghl/agmatch.cpp

@ -92,7 +92,7 @@ void AgMatch::Think()
void AgMatch::Start(const AgString& sSpawn) 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; return;
//Count players //Count players

4
dlls/aghl/agsettings.cpp

@ -74,9 +74,9 @@ bool AgSettings::Think()
m_fNextCheck = gpGlobals->time + 5.0; //Every 5 seconds. m_fNextCheck = gpGlobals->time + 5.0; //Every 5 seconds.
//Check if to display next map. //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 #ifdef AG_NO_CLIENT_DLL
AgSay(NULL,UTIL_VarArgs("Next map is %s\n",GetNextLevel().c_str()),NULL,30,0.03,0.05,2); 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)
FStrEq(m_sVote.c_str(),"agkick") || FStrEq(m_sVote.c_str(),"agkick") ||
FStrEq(m_sVote.c_str(),"agadmin") ) FStrEq(m_sVote.c_str(),"agadmin") )
{ {
if (FStrEq(m_sVote.c_str(),"agkick") && 1 > ag_vote_kick.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(),"agadmin") && 1 > ag_vote_admin.value )
||FStrEq(m_sVote.c_str(),"agallow") && 1 > ag_vote_allow.value || ( FStrEq(m_sVote.c_str(),"agallow") && 1 > ag_vote_allow.value )
) )
{ {
AgConsole("Vote is not allowed by server admin.",pPlayer); AgConsole("Vote is not allowed by server admin.",pPlayer);

12
dlls/player.cpp

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

Loading…
Cancel
Save