void MSG_WriteString (sizebuf_t *sb, const char *s)
{
- if (!s)
- SZ_Write (sb, (unsigned char *)"", 1);
+ if (!s || !*s)
+ MSG_WriteChar (sb, 0);
else
SZ_Write (sb, (unsigned char *)s, (int)strlen(s)+1);
}
void MSG_WriteUnterminatedString (sizebuf_t *sb, const char *s)
{
- if (s)
+ if (s && *s)
SZ_Write (sb, (unsigned char *)s, (int)strlen(s));
}
{
if (j < n)
{
- if (d[j] >= ' ' && d[j] <= 127)
+ // color change prefix character has to be treated specially
+ if (d[j] == STRING_COLOR_TAG)
+ {
+ *cur++ = STRING_COLOR_TAG;
+ *cur++ = STRING_COLOR_TAG;
+ }
+ else if (d[j] >= ' ')
*cur++ = d[j];
else
*cur++ = '.';
{"ATAC Campaign", 0, 3},
};
+static level_t prydonlevels[] =
+{
+ {"curig2", "Capel Curig"}, // 0
+
+ {"tdastart", "Gateway"}, // 1
+};
+
+static episode_t prydonepisodes[] =
+{
+ {"Prydon Gate", 0, 1},
+ {"The Dark Age", 1, 1}
+};
+
static gamelevels_t sharewarequakegame = {"Shareware Quake", quakelevels, quakeepisodes, 2};
static gamelevels_t registeredquakegame = {"Quake", quakelevels, quakeepisodes, 7};
static gamelevels_t hipnoticgame = {"Scourge of Armagon", hipnoticlevels, hipnoticepisodes, 6};
static gamelevels_t battlemechgame = {"Battlemech", battlemechlevels, battlemechepisodes, 1};
static gamelevels_t openquartzgame = {"OpenQuartz", openquartzlevels, openquartzepisodes, 3};
static gamelevels_t defeatindetail2game = {"Defeat In Detail 2", defeatindetail2levels, defeatindetail2episodes, 1};
+static gamelevels_t prydongame = {"Prydon Gate", prydonlevels, prydonepisodes, 2};
typedef struct gameinfo_s
{
{GAME_BATTLEMECH, &battlemechgame, &battlemechgame},
{GAME_OPENQUARTZ, &openquartzgame, &openquartzgame},
{GAME_DEFEATINDETAIL2, &defeatindetail2game, &defeatindetail2game},
- {(gamemode_t)-1, &sharewarequakegame, ®isteredquakegame} // final fallback
+ {GAME_PRYDON, &prydongame, &prydongame},
+ {GAME_NORMAL, NULL, NULL} // terminator
};
static gamelevels_t *lookupgameinfo(void)
{
- int i;
- for (i = 0;gamelist[i].gameid >= 0 && gamelist[i].gameid != gamemode;i++);
+ int i = 0;
+ while (gamelist[i].gameid != gamemode)
+ {
+ if (gamelist[i].notregistered == NULL)
+ {
+ i = 0;
+ break;
+ }
+ i++;
+ }
if (registered.integer)
return gamelist[i].registered;
else
entnum = PRVM_G_EDICTNUM(OFS_PARM0);
if (entnum < 1 || entnum > svs.maxclients || !svs.clients[entnum-1].active)
- {
- Con_Print("tried to sprint to a non-client\n");
- return;
- }
+ PF_WARNING("tried to centerprint to a non-client\n");
client = svs.clients + entnum-1;
if (!client->netconnection)
entnum = PRVM_G_EDICTNUM(OFS_PARM0);
if (entnum < 1 || entnum > svs.maxclients || !svs.clients[entnum-1].active)
- {
- Con_Print("tried to sprint to a non-client\n");
- return;
- }
+ PF_WARNING("tried to centerprint to a non-client\n");
client = svs.clients + entnum-1;
if (!client->netconnection)
entnum = PRVM_G_EDICTNUM(OFS_PARM0);
if (entnum < 1 || entnum > svs.maxclients || !svs.clients[entnum-1].active)
- {
- Con_Print("Can't stuffcmd to a non-client\n");
- return;
- }
+ PF_WARNING("Can't stuffcmd to a non-client\n");
VM_VarString(1, string, sizeof(string));