Browse Source

Fix warnings.

bubblemod
Night Owl 7 years ago
parent
commit
7b66e7aaa3
  1. 4
      dlls/bubblemod/BMOD_CameraPoint.cpp
  2. 2
      dlls/bubblemod/BMOD_flyingcrowbar.cpp
  3. 2
      dlls/bubblemod/BMOD_messaging.cpp
  4. 4
      dlls/bubblemod/BMOD_messaging.h
  5. 30
      dlls/bubblemod/BMOD_player.cpp
  6. 2
      dlls/bubblemod/BMOD_rune.h
  7. 12
      dlls/bubblemod/BMOD_snarkmine.cpp
  8. 4
      dlls/bubblemod/BMOD_util.cpp
  9. 8
      dlls/multiplay_gamerules.cpp
  10. 2
      dlls/squeakgrenade.cpp
  11. 2
      dlls/util.h

4
dlls/bubblemod/BMOD_CameraPoint.cpp

@ -60,11 +60,11 @@ void CCamPoint::Think( void )
// If we have no owner, our owner is not in type mode, // If we have no owner, our owner is not in type mode,
// our owner is not connected, our owner is invisible, // our owner is not connected, our owner is invisible,
// or our owner is a defuct player, remove ourselves. // or our owner is a defuct player, remove ourselves.
if (!m_pOwner if( !m_pOwner
|| !m_pOwner->m_bIsConnected || !m_pOwner->m_bIsConnected
|| !m_pOwner->m_bTypeMode || !m_pOwner->m_bTypeMode
|| m_pOwner->pev->effects & EF_NODRAW || m_pOwner->pev->effects & EF_NODRAW
|| (STRING(m_pOwner->pev->netname)[0] == 0) || ( ( STRING( m_pOwner->pev->netname ) )[0] == 0 )
) { ) {
// UTIL_ClientPrintAll( HUD_PRINTTALK, "<SERVER> Camera point destroyed.\n"); // UTIL_ClientPrintAll( HUD_PRINTTALK, "<SERVER> Camera point destroyed.\n");
UTIL_Remove( this ); UTIL_Remove( this );

2
dlls/bubblemod/BMOD_flyingcrowbar.cpp

@ -92,7 +92,7 @@ void CFlyingCrowbar::SpinTouch( CBaseEntity *pOther )
ClearMultiDamage( ); ClearMultiDamage( );
pOther->TraceAttack(pev, 90, pev->velocity.Normalize(), &tr, pOther->TraceAttack(pev, 90, pev->velocity.Normalize(), &tr,
DMG_NEVERGIB ); DMG_NEVERGIB );
if (m_hOwner != NULL) if( m_hOwner != 0 )
ApplyMultiDamage( pev, m_hOwner->pev ); ApplyMultiDamage( pev, m_hOwner->pev );
else else
ApplyMultiDamage( pev, pev ); ApplyMultiDamage( pev, pev );

2
dlls/bubblemod/BMOD_messaging.cpp

@ -42,7 +42,7 @@ extern cvar_t fraglimit;
// Special msg values: // Special msg values:
// "SPEC" - spectator message. // "SPEC" - spectator message.
// //
void PrintMessage( CBaseEntity *pEnt, int iChannel, Vector vecColor, Vector vecTime, char *msg) void PrintMessage( CBaseEntity *pEnt, int iChannel, Vector vecColor, Vector vecTime, const char *msg )
{ {
char szText[256]; char szText[256];
hudtextparms_t hText = {0}; hudtextparms_t hText = {0};

4
dlls/bubblemod/BMOD_messaging.h

@ -39,6 +39,6 @@
#define BMOD_CHAN_COUNTDOWN 3 #define BMOD_CHAN_COUNTDOWN 3
#define BMOD_CHAN_WEAPON 4 #define BMOD_CHAN_WEAPON 4
void PrintMessage( CBaseEntity *pEnt, int iChannel, Vector vecColor, Vector vecTime, char *msg); void PrintMessage( CBaseEntity *pEnt, int iChannel, Vector vecColor, Vector vecTime, const char *msg);
#endif #endif

30
dlls/bubblemod/BMOD_player.cpp

@ -65,7 +65,7 @@ void CBasePlayer::StartObserver( Vector vecPosition, Vector vecViewAngle )
m_pActiveItem->Holster( ); m_pActiveItem->Holster( );
// ?? Let go of tanks? // ?? Let go of tanks?
if ( m_pTank != NULL ) if( m_pTank != 0 )
{ {
m_pTank->Use( this, this, USE_OFF, 0 ); m_pTank->Use( this, this, USE_OFF, 0 );
m_pTank = NULL; m_pTank = NULL;
@ -190,8 +190,8 @@ void CBasePlayer::Observer_FindNextPlayer( bool bReverse )
// Don't spec observers or invisible players or defunct players // Don't spec observers or invisible players or defunct players
if ( ((CBasePlayer*)pEnt)->IsObserver() if ( ((CBasePlayer*)pEnt)->IsObserver()
|| (pEnt->pev->effects & EF_NODRAW) || (pEnt->pev->effects & EF_NODRAW)
|| (STRING(pEnt->pev->netname)[0] == 0) || ( ( STRING( pEnt->pev->netname ) )[0] == 0 )
|| (!((CBasePlayer*)pEnt)->m_bIsConnected) || (!((CBasePlayer*)pEnt)->m_bIsConnected)
) )
continue; continue;
@ -272,7 +272,7 @@ void CBasePlayer::Observer_HandleButtons()
m_afButtonReleased = 0; m_afButtonReleased = 0;
pev->impulse = 0; pev->impulse = 0;
if ((m_hObserverTarget != NULL) && (m_hObserverTarget->IsPlayer()) && (pev->iuser1 == OBS_CHASE_FREE)) if ((m_hObserverTarget != 0) && (m_hObserverTarget->IsPlayer()) && (pev->iuser1 == OBS_CHASE_FREE))
{ {
pev->origin = m_hObserverTarget->pev->origin; pev->origin = m_hObserverTarget->pev->origin;
pev->velocity = m_hObserverTarget->pev->velocity; pev->velocity = m_hObserverTarget->pev->velocity;
@ -304,7 +304,7 @@ void CBasePlayer::Observer_SetMode( int iMode )
if ( iMode == OBS_CHASE_LOCKED ) if ( iMode == OBS_CHASE_LOCKED )
{ {
// If changing from Roaming, or starting observing, make sure there is a target // If changing from Roaming, or starting observing, make sure there is a target
if ( m_hObserverTarget == NULL ) if ( m_hObserverTarget == 0 )
Observer_FindNextPlayer( false ); Observer_FindNextPlayer( false );
if (m_hObserverTarget) if (m_hObserverTarget)
@ -589,25 +589,25 @@ void CBasePlayer::BMOD_Identify( void )
strcat(szExtra, "\nTyping! DO NOT SHOOT!"); strcat(szExtra, "\nTyping! DO NOT SHOOT!");
} }
CBasePlayer *pPlayer = (CBasePlayer *)pOther; CBasePlayer *pOtherPlayer = (CBasePlayer *)pOther;
if (IsObserver()) if (IsObserver())
ClientPrint( pev, HUD_PRINTCENTER, UTIL_VarArgs ("-%s-\n(%s) %i / %i%s", ClientPrint( pev, HUD_PRINTCENTER, UTIL_VarArgs ("-%s-\n(%s) %i / %i%s",
STRING( pPlayer->pev->netname ), STRING( pOtherPlayer->pev->netname ),
g_engfuncs.pfnInfoKeyValue( g_engfuncs.pfnGetInfoKeyBuffer( pPlayer->edict() ), "model" ), g_engfuncs.pfnInfoKeyValue( g_engfuncs.pfnGetInfoKeyBuffer( pOtherPlayer->edict() ), "model" ),
(int)pPlayer->pev->health, (int)pOtherPlayer->pev->health,
(int)pPlayer->pev->armorvalue, (int)pOtherPlayer->pev->armorvalue,
szExtra szExtra
) ); ) );
else if ( g_pGameRules->PlayerRelationship( pOther, this ) == GR_TEAMMATE ) else if ( g_pGameRules->PlayerRelationship( pOther, this ) == GR_TEAMMATE )
ClientPrint( pev, HUD_PRINTCENTER, UTIL_VarArgs ("-%s-\n%i / %i", ClientPrint( pev, HUD_PRINTCENTER, UTIL_VarArgs ("-%s-\n%i / %i",
STRING( pPlayer->pev->netname ), STRING( pOtherPlayer->pev->netname ),
(int)pPlayer->pev->health, (int)pOtherPlayer->pev->health,
(int)pPlayer->pev->armorvalue) (int)pOtherPlayer->pev->armorvalue)
); );
else else
ClientPrint( pev, HUD_PRINTCENTER, UTIL_VarArgs ("-%s-\n(%s)%s", ClientPrint( pev, HUD_PRINTCENTER, UTIL_VarArgs ("-%s-\n(%s)%s",
STRING( pPlayer->pev->netname ), STRING( pOtherPlayer->pev->netname ),
g_engfuncs.pfnInfoKeyValue( g_engfuncs.pfnGetInfoKeyBuffer( pPlayer->edict() ), "model" ), g_engfuncs.pfnInfoKeyValue( g_engfuncs.pfnGetInfoKeyBuffer( pOtherPlayer->edict() ), "model" ),
szExtra szExtra
) ); ) );

2
dlls/bubblemod/BMOD_rune.h

@ -40,7 +40,7 @@ public:
void EXPORT MaterializeRandom( void ); void EXPORT MaterializeRandom( void );
virtual BOOL MyTouch( CBasePlayer *pPlayer ) { EMIT_SOUND( pPlayer->edict(), CHAN_ITEM, "items/gunpickup2.wav", 1, ATTN_NORM ); return TRUE; }; virtual BOOL MyTouch( CBasePlayer *pPlayer ) { EMIT_SOUND( pPlayer->edict(), CHAN_ITEM, "items/gunpickup2.wav", 1, ATTN_NORM ); return TRUE; };
BOOL IsRune( void ) { return TRUE; } BOOL IsRune( void ) { return TRUE; }
virtual char* RuneName ( void ) { return "Generic Rune"; } virtual const char* RuneName ( void ) { return "Generic Rune"; }
BOOL m_randomize; BOOL m_randomize;
Vector m_vRuneColor; Vector m_vRuneColor;

12
dlls/bubblemod/BMOD_snarkmine.cpp

@ -50,7 +50,7 @@ enum tripmine_e {
TRIPMINE_HOLSTER, TRIPMINE_HOLSTER,
TRIPMINE_DRAW, TRIPMINE_DRAW,
TRIPMINE_WORLD, TRIPMINE_WORLD,
TRIPMINE_GROUND, TRIPMINE_GROUND
}; };
LINK_ENTITY_TO_CLASS( monster_tripsnark, CTripSnarkGrenade ); LINK_ENTITY_TO_CLASS( monster_tripsnark, CTripSnarkGrenade );
@ -149,7 +149,7 @@ void CTripSnarkGrenade :: PowerupThink( void )
{ {
TraceResult tr; TraceResult tr;
if (m_hOwner == NULL) if( m_hOwner == 0 )
{ {
// find an owner // find an owner
edict_t *oldowner = pev->owner; edict_t *oldowner = pev->owner;
@ -289,14 +289,14 @@ void CTripSnarkGrenade :: BeamBreakThink( void )
} }
else else
{ {
if (m_hOwner == NULL) if( m_hOwner == 0 )
bBlowup = 1; bBlowup = 1;
else if (m_posOwner != m_hOwner->pev->origin) else if( m_posOwner != m_hOwner->pev->origin )
bBlowup = 1; bBlowup = 1;
else if (m_angleOwner != m_hOwner->pev->angles) else if( m_angleOwner != m_hOwner->pev->angles )
bBlowup = 1; bBlowup = 1;
} }
if (bBlowup) if (bBlowup)
{ {
// a bit of a hack, but all CGrenade code passes pev->owner along to make sure the proper player gets credit for the kill // a bit of a hack, but all CGrenade code passes pev->owner along to make sure the proper player gets credit for the kill

4
dlls/bubblemod/BMOD_util.cpp

@ -216,7 +216,7 @@ BOOL UTIL_OBB_PointTest(Vector vecSrc, Vector boxP, Vector boxE)
return TRUE; return TRUE;
} }
void UTIL_SpeakAll( char *message ) void UTIL_SpeakAll( const char *message )
{ {
char text[256]; char text[256];
strcpy(text, "speak \""); strcpy(text, "speak \"");
@ -491,7 +491,7 @@ void UTIL_SayTime( void ) {
hour = hour > 12 ? hour - 12 : hour; hour = hour > 12 ? hour - 12 : hour;
hour = hour == 0 ? 12 : hour; hour = hour == 0 ? 12 : hour;
int min = adjustedTime->tm_min; int min = adjustedTime->tm_min;
char *ampm = "AM"; const char *ampm = "AM";
if (adjustedTime->tm_hour > 11) if (adjustedTime->tm_hour > 11)
ampm = "PM"; ampm = "PM";

8
dlls/multiplay_gamerules.cpp

@ -1007,12 +1007,12 @@ void CHalfLifeMultiplay::DeathNotice( CBasePlayer *pVictim, entvars_t *pKiller,
// BMOD Start - match kills. // BMOD Start - match kills.
// tag kills where killer matched weapons with victim. // tag kills where killer matched weapons with victim.
if( bm_matchkills.value && strcmp( killer_weapon_name, "tripmine" ) && strcmp( killer_weapon_name, "snark" ) && if( ( bm_matchkills.value && strcmp( killer_weapon_name, "tripmine" ) && strcmp( killer_weapon_name, "snark" ) &&
( pVictim->m_pActiveItem && ( pVictim->m_pActiveItem &&
( (CBasePlayer *)Killer )->m_pActiveItem && ( (CBasePlayer *)Killer )->m_pActiveItem &&
!strcmp( STRING( ( (CBasePlayer *)Killer )->m_pActiveItem->pev->classname ), !strcmp( STRING( ( (CBasePlayer *)Killer )->m_pActiveItem->pev->classname ),
STRING( pVictim->m_pActiveItem->pev->classname ) ) && STRING( pVictim->m_pActiveItem->pev->classname ) ) &&
( (CBasePlayer *)Killer )->m_RuneFlags == RUNE_NONE ) ( (CBasePlayer *)Killer )->m_RuneFlags == RUNE_NONE ) )
|| // OR... || // OR...
( !strcmp( killer_weapon_name, "flying_crowbar" ) && ( !strcmp( killer_weapon_name, "flying_crowbar" ) &&
( !pVictim->m_pActiveItem || ( !pVictim->m_pActiveItem ||
@ -1041,8 +1041,8 @@ void CHalfLifeMultiplay::DeathNotice( CBasePlayer *pVictim, entvars_t *pKiller,
weapon_name = STRING( pVictim->m_pActiveItem->pev->classname ); weapon_name = STRING( pVictim->m_pActiveItem->pev->classname );
// Hack to fix name change // Hack to fix name change
char *rpg = "rpg_rocket"; const char *rpg = "rpg_rocket";
char *hand_grenade = "hand_grenade"; const char *hand_grenade = "hand_grenade";
// strip the monster_* or weapon_* from the classname // strip the monster_* or weapon_* from the classname
if( strncmp( weapon_name, "weapon_", 7 ) == 0 ) if( strncmp( weapon_name, "weapon_", 7 ) == 0 )

2
dlls/squeakgrenade.cpp

@ -230,7 +230,7 @@ void CSqueakGrenade::HuntThink( void )
m_hEnemy = BMOD_BestVisibleEnemy(); m_hEnemy = BMOD_BestVisibleEnemy();
} }
if( m_hEnemy!= NULL && m_hEnemy->IsPlayer() ) if( m_hEnemy!= 0 && m_hEnemy->IsPlayer() )
{ {
CBasePlayer* pPlayer = (CBasePlayer*)( (CBaseEntity *)m_hEnemy ); CBasePlayer* pPlayer = (CBasePlayer*)( (CBaseEntity *)m_hEnemy );
if( pPlayer->BMOD_IsTyping() ) if( pPlayer->BMOD_IsTyping() )

2
dlls/util.h

@ -587,7 +587,7 @@ CBasePlayer* UTIL_CastPlayer( int index );
BOOL UTIL_OBB_LineTest( Vector vecSrc, Vector vecDst, Vector boxP, Vector boxE ); BOOL UTIL_OBB_LineTest( Vector vecSrc, Vector vecDst, Vector boxP, Vector boxE );
BOOL UTIL_OBB_PointTest( Vector vecSrc, Vector boxP, Vector boxE ); BOOL UTIL_OBB_PointTest( Vector vecSrc, Vector boxP, Vector boxE );
void UTIL_SpeakAll( char *message ); void UTIL_SpeakAll( const char *message );
char *UTIL_CountVotes( void ); char *UTIL_CountVotes( void );
void UTIL_SpeakBadWeapon( void ); void UTIL_SpeakBadWeapon( void );
char *UTIL_CountVotes( void ); char *UTIL_CountVotes( void );

Loading…
Cancel
Save