summaryrefslogtreecommitdiff
path: root/source/q_msg.c
diff options
context:
space:
mode:
authorAndrey Nazarov <skuller@skuller.net>2008-06-29 12:32:32 +0000
committerAndrey Nazarov <skuller@skuller.net>2008-06-29 12:32:32 +0000
commite826e5f176f21cd18b3bbc22887a266835ada57c (patch)
treed25a84a84f9168b16a77fe4ed8b169c9611bbb02 /source/q_msg.c
parent491f1c100e860c45a5d2aa358d58f777cd1cf895 (diff)
Added client and server side support for 32-bit solids.
New R1Q2 and Q2PRO minor protocol versions, 1905 and 1014. Use environment variables for game and server features negotiation. Relax restrictions on quake paths when searching inside pak files. Made OSS subsystem cvar names consistent with core sound system conventions. Misc latched cvar handling changes.
Diffstat (limited to 'source/q_msg.c')
-rw-r--r--source/q_msg.c43
1 files changed, 31 insertions, 12 deletions
diff --git a/source/q_msg.c b/source/q_msg.c
index d78fb25..f734a35 100644
--- a/source/q_msg.c
+++ b/source/q_msg.c
@@ -713,8 +713,13 @@ void MSG_WriteDeltaEntity( const entity_state_t *from,
MSG_WriteByte (to->sound);
if (bits & U_EVENT)
MSG_WriteByte (to->event);
- if (bits & U_SOLID)
- MSG_WriteShort (to->solid);
+ if (bits & U_SOLID) {
+ if( flags & MSG_ES_LONGSOLID ) {
+ MSG_WriteLong (to->solid);
+ } else {
+ MSG_WriteShort (to->solid);
+ }
+ }
}
/*
@@ -1895,13 +1900,17 @@ MSG_ParseDeltaEntity
Can go from either a baseline or a previous packet_entity
==================
*/
-void MSG_ParseDeltaEntity( const entity_state_t *from, entity_state_t *to, int number, int bits ) {
+void MSG_ParseDeltaEntity( const entity_state_t *from,
+ entity_state_t *to,
+ int number,
+ int bits )
+{
if( !to ) {
- Com_Error( ERR_DROP, "MSG_ParseDeltaEntity: NULL" );
+ Com_Error( ERR_DROP, "%s: NULL", __func__ );
}
if( number < 1 || number >= MAX_EDICTS ) {
- Com_Error( ERR_DROP, "MSG_ParseDeltaEntity: bad entity number %i", number );
+ Com_Error( ERR_DROP, "%s: bad entity number: %d", __func__, number );
}
// set everything to the state we are delta'ing from
@@ -1916,7 +1925,7 @@ void MSG_ParseDeltaEntity( const entity_state_t *from, entity_state_t *to, int n
to->number = number;
to->event = 0;
- if( !bits ) {
+ if( ( bits & U_MASK ) == 0 ) {
return;
}
@@ -1992,7 +2001,11 @@ void MSG_ParseDeltaEntity( const entity_state_t *from, entity_state_t *to, int n
}
if( bits & U_SOLID ) {
- to->solid = MSG_ReadWord();
+ if( bits & U_SOLID32 ) {
+ to->solid = MSG_ReadLong();
+ } else {
+ to->solid = MSG_ReadWord();
+ }
}
}
@@ -2001,12 +2014,15 @@ void MSG_ParseDeltaEntity( const entity_state_t *from, entity_state_t *to, int n
MSG_ParseDeltaPlayerstate_Default
===================
*/
-void MSG_ParseDeltaPlayerstate_Default( const player_state_t *from, player_state_t *to, int flags ) {
+void MSG_ParseDeltaPlayerstate_Default( const player_state_t *from,
+ player_state_t *to,
+ int flags )
+{
int i;
int statbits;
if( !to ) {
- Com_Error( ERR_DROP, "MSG_ParseDeltaPlayerstate_Default: NULL" );
+ Com_Error( ERR_DROP, "%s: NULL", __func__ );
}
// clear to old value before delta parsing
@@ -2119,7 +2135,7 @@ void MSG_ParseDeltaPlayerstate_Enhanced( const player_state_t *from,
int statbits;
if( !to ) {
- Com_Error( ERR_DROP, "MSG_ParseDeltaPlayerstate_Enhanced: NULL" );
+ Com_Error( ERR_DROP, "%s: NULL", __func__ );
}
// clear to old value before delta parsing
@@ -2242,12 +2258,15 @@ void MSG_ParseDeltaPlayerstate_Enhanced( const player_state_t *from,
MSG_ParseDeltaPlayerstate_Packet
===================
*/
-void MSG_ParseDeltaPlayerstate_Packet( const player_state_t *from, player_state_t *to, int flags ) {
+void MSG_ParseDeltaPlayerstate_Packet( const player_state_t *from,
+ player_state_t *to,
+ int flags )
+{
int i;
int statbits;
if( !to ) {
- Com_Error( ERR_DROP, "MSG_ParseDeltaPlayerstate_Packet: NULL" );
+ Com_Error( ERR_DROP, "%s: NULL", __func__ );
}
// clear to old value before delta parsing