Skip to content

Commit

Permalink
configstring enhanced locs
Browse files Browse the repository at this point in the history
  • Loading branch information
deathsythe47 committed Jul 7, 2017
1 parent acc6830 commit e62eda6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions game/bg_public.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
#define CS_SHADERSTATE 24
#define CS_BOTINFO 25
#define CS_SERVERFEATURELIST CS_BOTINFO // added
#define CS_ENHANCEDLOCATIONS 26 // added
#define CS_ITEMS 27 // string of 0's and 1's that tell which items are present

#define CS_CLIENT_JEDIMASTER 28 // current jedi master
Expand Down
10 changes: 5 additions & 5 deletions game/g_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -3066,23 +3066,23 @@ void G_BroadcastServerFeatureList( int clientNum ) {
"class \"Changes Siege class on current team\" "
"serverstatus2 \"View additional server settings not listed in serverstatus\"";

static char locationsListCmd[MAX_TOKEN_CHARS] = { 0 };
static char locationsListConfigString[MAX_TOKEN_CHARS] = { 0 };

// lazy initialization of the locations strings

if ( level.locations.enhanced.numUnique && !*locationsListCmd ) {
Q_strncpyz( locationsListCmd, "kls -1 -1 locs", sizeof( locationsListCmd ) );
if ( level.locations.enhanced.numUnique && !*locationsListConfigString ) {
Q_strncpyz( locationsListConfigString, "locs", sizeof( locationsListConfigString ) );

int i;
for ( i = 0; i < level.locations.enhanced.numUnique; ++i ) {
Q_strcat( locationsListCmd, sizeof( locationsListCmd ), va( " \"%s\" %d", level.locations.enhanced.data[i].message, level.locations.enhanced.data[i].teamowner ) );
Q_strcat( locationsListConfigString, sizeof( locationsListConfigString ), va( " \"%s\" %d", level.locations.enhanced.data[i].message, level.locations.enhanced.data[i].teamowner ) );
}
}

trap_SetConfigstring(CS_SERVERFEATURELIST, featureListConfigString);
trap_SendServerCommand( clientNum, commandListCmd );
if ( level.locations.enhanced.numUnique )
trap_SendServerCommand( clientNum, locationsListCmd );
trap_SetConfigstring(CS_ENHANCEDLOCATIONS, locationsListConfigString);
}
#endif

Expand Down

0 comments on commit e62eda6

Please sign in to comment.