1 | /* |
1 | /* |
2 | * This file is part of Deliantra, the Roguelike Realtime MMORPG. |
2 | * This file is part of Deliantra, the Roguelike Realtime MMORPG. |
3 | * |
3 | * |
4 | * Copyright (©) 2005,2006,2007,2008 Marc Alexander Lehmann / Robin Redeker / the Deliantra team |
4 | * Copyright (©) 2005,2006,2007,2008,2009 Marc Alexander Lehmann / Robin Redeker / the Deliantra team |
5 | * Copyright (©) 2002,2007 Mark Wedel & Crossfire Development Team |
5 | * Copyright (©) 2002,2007 Mark Wedel & Crossfire Development Team |
6 | * Copyright (©) 1992,2007 Frank Tore Johansen |
6 | * Copyright (©) 1992,2007 Frank Tore Johansen |
7 | * |
7 | * |
8 | * Deliantra is free software: you can redistribute it and/or modify |
8 | * Deliantra is free software: you can redistribute it and/or modify |
9 | * it under the terms of the GNU General Public License as published by |
9 | * it under the terms of the GNU General Public License as published by |
… | |
… | |
337 | buf << "<"; |
337 | buf << "<"; |
338 | break; |
338 | break; |
339 | |
339 | |
340 | case '\r': |
340 | case '\r': |
341 | buf << '\n'; |
341 | buf << '\n'; |
|
|
342 | /* \r\n+ becomes one or more newlines */ |
|
|
343 | while (*cfpod == '\n') |
|
|
344 | buf << *cfpod++; |
342 | break; |
345 | break; |
343 | |
346 | |
344 | case '\n': |
347 | case '\n': |
345 | if (end == -2) |
348 | if (end == -2) |
346 | return cfpod; |
349 | return cfpod; |
… | |
… | |
406 | { |
409 | { |
407 | cfpod = expand_cfpod (pl, nest, cfpod, end); |
410 | cfpod = expand_cfpod (pl, nest, cfpod, end); |
408 | nest.clear (); |
411 | nest.clear (); |
409 | |
412 | |
410 | if (pl->hintmode == 1) |
413 | if (pl->hintmode == 1) |
411 | buf << "<fg name=\"lightblue\">[Hint suppressed, see hintmode]</fg>"; |
414 | buf << "<fg name=\"lightblue\">[Hint available]</fg>"; |
412 | else |
415 | else |
413 | while (*cfpod == ' ') // eat trailing whitespace |
416 | while (*cfpod <= ' '&& *cfpod) // eat trailing whitespace |
414 | ++cfpod; |
417 | ++cfpod; |
415 | |
418 | |
416 | goto skip; |
419 | goto skip; |
417 | } |
420 | } |
418 | else |
421 | else |
419 | { |
422 | { |
420 | pfx = "<fg name=\"lightblue\">["; |
423 | pfx = "<fg name=\"lightblue\">[Hint: "; |
421 | sfx = " (Use hintmode to suppress hints)]</fg>"; |
424 | sfx = "]</fg>"; |
422 | } |
425 | } |
423 | } |
426 | } |
424 | break; |
427 | break; |
425 | |
428 | |
426 | case 'G': // gender |
429 | case 'G': // gender |