summaryrefslogtreecommitdiff
path: root/source/mvd_parse.c
diff options
context:
space:
mode:
authorAndrey Nazarov <skuller@skuller.net>2008-09-26 14:07:50 +0000
committerAndrey Nazarov <skuller@skuller.net>2008-09-26 14:07:50 +0000
commitcb9fb567a6a341b9894b05ee229b5c95ec5f82c6 (patch)
tree96b2ba5060489b214237b09d3d950ec5cfef0e57 /source/mvd_parse.c
parentb52910ce251f120df02ab3ee31896d820a48583a (diff)
MVD channels now use unique spawncounts for clients checking those.
Moved POV info from top of the screen and made it include channel name.
Diffstat (limited to 'source/mvd_parse.c')
-rw-r--r--source/mvd_parse.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/source/mvd_parse.c b/source/mvd_parse.c
index 58aea8d..8e3da08 100644
--- a/source/mvd_parse.c
+++ b/source/mvd_parse.c
@@ -611,10 +611,20 @@ static void MVD_ParseSound( mvd_t *mvd, int extrabits ) {
}
}
+static void set_player_name( mvd_player_t *player, const char *string ) {
+ char *p;
+
+ Q_strlcpy( player->name, string, sizeof( player->name ) );
+ p = strchr( player->name, '\\' );
+ if( p ) {
+ *p = 0;
+ }
+}
+
static void MVD_ParseConfigstring( mvd_t *mvd ) {
int index;
size_t len, maxlen;
- char *string, *p;
+ char *string;
udpClient_t *client;
mvd_player_t *player;
mvd_cs_t *cs, **pcs;
@@ -635,11 +645,7 @@ static void MVD_ParseConfigstring( mvd_t *mvd ) {
if( index >= CS_PLAYERSKINS && index < CS_PLAYERSKINS + mvd->maxclients ) {
// update player name
player = &mvd->players[ index - CS_PLAYERSKINS ];
- Q_strlcpy( player->name, string, sizeof( player->name ) );
- p = strchr( player->name, '\\' );
- if( p ) {
- *p = 0;
- }
+ set_player_name( player, string );
LIST_FOR_EACH( udpClient_t, client, &mvd->udpClients, entry ) {
if( client->cl->state < cs_spawned ) {
continue;
@@ -886,7 +892,7 @@ static void MVD_ParseFrame( mvd_t *mvd ) {
static void MVD_ParseServerData( mvd_t *mvd ) {
int protocol;
size_t len, maxlen;
- char *string, *p;
+ char *string;
int i, index;
mvd_player_t *player;
@@ -989,13 +995,7 @@ static void MVD_ParseServerData( mvd_t *mvd ) {
for( i = 0; i < mvd->maxclients; i++ ) {
player = &mvd->players[i];
string = mvd->configstrings[ CS_PLAYERSKINS + i ];
- if( *string ) {
- Q_strlcpy( player->name, string, sizeof( player->name ) );
- p = strchr( player->name, '\\' );
- if( p ) {
- *p = 0;
- }
- }
+ set_player_name( player, string );
}
// get the spawn point for spectators