summaryrefslogtreecommitdiff
path: root/src/qcommon/msg.c
diff options
context:
space:
mode:
authorZack Middleton <zturtleman@gmail.com>2012-12-16 00:15:14 +0000
committerTim Angus <tim@ngus.net>2013-01-12 21:26:42 +0000
commitf21f0a7b46f28438259e4baea36281e31add34d8 (patch)
treef7e7403e1423f94c8f226e55e7d336e14c561985 /src/qcommon/msg.c
parentc7799bc0ae45e6d40145d7e277e6bcfdca338233 (diff)
Fix dedicated server crashing when using MSG_ReadDelta*, though it only happens if someone modifies the engine. (#5449)
Diffstat (limited to 'src/qcommon/msg.c')
-rw-r--r--src/qcommon/msg.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/qcommon/msg.c b/src/qcommon/msg.c
index a0c17d73..b2377f1d 100644
--- a/src/qcommon/msg.c
+++ b/src/qcommon/msg.c
@@ -551,7 +551,7 @@ delta functions
extern cvar_t *cl_shownet;
-#define LOG(x) if( cl_shownet->integer == 4 ) { Com_Printf("%s ", x ); };
+#define LOG(x) if( cl_shownet && cl_shownet->integer == 4 ) { Com_Printf("%s ", x ); };
void MSG_WriteDelta( msg_t *msg, int oldV, int newV, int bits ) {
if ( oldV == newV ) {
@@ -1040,7 +1040,7 @@ void MSG_ReadDeltaEntity( msg_t *msg, entityState_t *from, entityState_t *to,
if ( MSG_ReadBits( msg, 1 ) == 1 ) {
Com_Memset( to, 0, sizeof( *to ) );
to->number = MAX_GENTITIES - 1;
- if ( cl_shownet->integer >= 2 || cl_shownet->integer == -1 ) {
+ if ( cl_shownet && ( cl_shownet->integer >= 2 || cl_shownet->integer == -1 ) ) {
Com_Printf( "%3i: #%-3i remove\n", msg->readcount, number );
}
return;
@@ -1062,7 +1062,7 @@ void MSG_ReadDeltaEntity( msg_t *msg, entityState_t *from, entityState_t *to,
// shownet 2/3 will interleave with other printed info, -1 will
// just print the delta records`
- if ( cl_shownet->integer >= 2 || cl_shownet->integer == -1 ) {
+ if ( cl_shownet && ( cl_shownet->integer >= 2 || cl_shownet->integer == -1 ) ) {
print = 1;
Com_Printf( "%3i: #%-3i ", msg->readcount, to->number );
} else {
@@ -1365,7 +1365,7 @@ void MSG_ReadDeltaPlayerstate (msg_t *msg, playerState_t *from, playerState_t *t
// shownet 2/3 will interleave with other printed info, -2 will
// just print the delta records
- if ( cl_shownet->integer >= 2 || cl_shownet->integer == -2 ) {
+ if ( cl_shownet && ( cl_shownet->integer >= 2 || cl_shownet->integer == -2 ) ) {
print = 1;
Com_Printf( "%3i: playerstate ", msg->readcount );
} else {