handle dos line endings. COM_FOpenFile /always/ opens files in binary
	mode in Windows (and *nix is effectively binary only anyway) and the
	\r characters being left in the location description strings was
	causing %l to print a blank line. Makes for unhappy users :/
teamplay.c:
	handle %%. this seams to have been missed.
This commit is contained in:
Bill Currie 2000-10-18 17:06:44 +00:00
parent 17ea696c0d
commit f837616025
2 changed files with 11 additions and 1 deletions

View file

@ -112,8 +112,13 @@ void locs_load(char *mapname)
loc[2] = strtol(t2, &t1, 0) * (1.0/8);
t1++;
t2 = strrchr(t1, '\n');
if (t2)
if (t2) {
t2[0] = '\0';
// handle dos format lines (COM_FOpenFile is binary only)
// and unix is effectively binary only anyway
if (t2 > t1 && t2[-1] == '\r')
t2[-1] = '\0';
}
locs_add(loc, t1);
}
Qclose(file);

View file

@ -145,6 +145,11 @@ char *Team_ParseSay (char *s)
s += 2;
}
switch (chr) {
case '%':
t2[0] = '%';
t2[1] = 0;
t1 = t2;
break;
case 's':
bracket = 0;
t1 = skin->string;