mirror of
https://git.code.sf.net/p/quake/newtree
synced 2025-03-14 04:01:06 +00:00
locs.c:
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:
parent
17ea696c0d
commit
f837616025
2 changed files with 11 additions and 1 deletions
|
@ -112,8 +112,13 @@ void locs_load(char *mapname)
|
||||||
loc[2] = strtol(t2, &t1, 0) * (1.0/8);
|
loc[2] = strtol(t2, &t1, 0) * (1.0/8);
|
||||||
t1++;
|
t1++;
|
||||||
t2 = strrchr(t1, '\n');
|
t2 = strrchr(t1, '\n');
|
||||||
if (t2)
|
if (t2) {
|
||||||
t2[0] = '\0';
|
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);
|
locs_add(loc, t1);
|
||||||
}
|
}
|
||||||
Qclose(file);
|
Qclose(file);
|
||||||
|
|
|
@ -145,6 +145,11 @@ char *Team_ParseSay (char *s)
|
||||||
s += 2;
|
s += 2;
|
||||||
}
|
}
|
||||||
switch (chr) {
|
switch (chr) {
|
||||||
|
case '%':
|
||||||
|
t2[0] = '%';
|
||||||
|
t2[1] = 0;
|
||||||
|
t1 = t2;
|
||||||
|
break;
|
||||||
case 's':
|
case 's':
|
||||||
bracket = 0;
|
bracket = 0;
|
||||||
t1 = skin->string;
|
t1 = skin->string;
|
||||||
|
|
Loading…
Reference in a new issue