ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/common/player.C
(Generate patch)

Comparing deliantra/server/common/player.C (file contents):
Revision 1.44 by root, Tue Sep 9 10:51:59 2008 UTC vs.
Revision 1.53 by root, Thu Sep 17 00:07:04 2009 UTC

46is_dragon_pl (const object *op) 46is_dragon_pl (const object *op)
47{ 47{
48 if (op 48 if (op
49 && op->type == PLAYER 49 && op->type == PLAYER
50 && op->arch 50 && op->arch
51 && op->arch->race 51 && op->arch->race == shstr_dragon)
52 && !strcmp (op->arch->race, "dragon"))
53 return 1; 52 return 1;
54 53
55 return 0; 54 return 0;
56} 55}
57 56
338 buf << "&lt;"; 337 buf << "&lt;";
339 break; 338 break;
340 339
341 case '\r': 340 case '\r':
342 buf << '\n'; 341 buf << '\n';
342 /* \r\n+ becomes one or more newlines */
343 while (*cfpod == '\n')
344 buf << *cfpod++;
343 break; 345 break;
344 346
345 case '\n': 347 case '\n':
346 if (end == -2) 348 if (end == -2)
347 return cfpod; 349 return cfpod;
356 --cfpod; 358 --cfpod;
357 do 359 do
358 buf << *cfpod++; 360 buf << *cfpod++;
359 while (*cfpod == '\n'); 361 while (*cfpod == '\n');
360 } 362 }
361 else if (*cfpod != ' ') 363 else if (*cfpod == ' ')
364 buf << '\n';
365 else
362 buf << ' '; 366 buf << ' ';
363 367
364 // verbatim block? 368 // verbatim block?
365 if (*cfpod == ' ') 369 if (*cfpod == ' ')
366 goto verbatim; 370 goto verbatim;
395 case 'C': pfx = "<tt>" ; sfx = "</tt>" ; break; 399 case 'C': pfx = "<tt>" ; sfx = "</tt>" ; break;
396 case 'E': pfx = "&" ; sfx = ";" ; break; 400 case 'E': pfx = "&" ; sfx = ";" ; break;
397 case 'I': pfx = "<i>" ; sfx = "</i>" ; break; 401 case 'I': pfx = "<i>" ; sfx = "</i>" ; break;
398 case 'U': pfx = "<u>" ; sfx = "</u>" ; break; 402 case 'U': pfx = "<u>" ; sfx = "</u>" ; break;
399 case 'T': pfx = "<big><b>"; sfx = "</b></big>"; break; 403 case 'T': pfx = "<big><b>"; sfx = "</b></big>"; break;
404 case 'Z': pfx = "" ; sfx = "" ; break;
400 405
401 case 'H': // hint 406 case 'H': // hint
402 { 407 {
403 if (pl->hintmode) 408 if (pl->hintmode)
404 { 409 {
405 cfpod = expand_cfpod (pl, nest, cfpod, end); 410 cfpod = expand_cfpod (pl, nest, cfpod, end);
406 nest.clear (); 411 nest.clear ();
407 412
408 if (pl->hintmode == 1) 413 if (pl->hintmode == 1)
409 buf << "<fg name=\"lightblue\">[Hint suppressed, see hintmode]</fg>"; 414 buf << "<fg name=\"lightblue\">[Hint available]</fg>";
410 else 415 else
411 while (*cfpod == ' ') // eat trailing whitespace 416 while (*cfpod <= ' '&& *cfpod) // eat trailing whitespace
412 ++cfpod; 417 ++cfpod;
413 418
414 goto skip; 419 goto skip;
415 } 420 }
416 else 421 else
417 { 422 {
418 pfx = "<fg name=\"lightblue\">["; 423 pfx = "<fg name=\"lightblue\">[Hint: ";
419 sfx = " (Use hintmode to suppress hints)]</fg>"; 424 sfx = "]</fg>";
420 } 425 }
421 } 426 }
422 break; 427 break;
423 428
424 case 'G': // gender 429 case 'G': // gender
425 { 430 {
426 expand_cfpod (pl, nest, cfpod, end); 431 cfpod = expand_cfpod (pl, nest, cfpod, end);
427 nest << '\0'; // zero-terminate 432 nest << '\0'; // zero-terminate
428 433
429 const char *str = nest.linearise (); 434 const char *str = nest.linearise ();
430 const char *sep = strchr (str, '|'); 435 const char *sep = strchr (str, '|');
431 436
432 if (sep) 437 if (sep)
433 { 438 {
434 if (pl->gender || 1) 439 if (pl->gender)
435 buf.add (sep + 1, nest.size () - (sep - str) - 2); 440 buf.add (sep + 1, nest.size () - (sep - str) - 2);
436 else 441 else
437 buf.add (str, sep - str); 442 buf.add (str, sep - str);
438 } 443 }
439 444
461 do 466 do
462 { 467 {
463 buf << "<tt>"; 468 buf << "<tt>";
464 cfpod = expand_cfpod (pl, buf, cfpod, -2); 469 cfpod = expand_cfpod (pl, buf, cfpod, -2);
465 buf << "</tt>\n"; 470 buf << "</tt>\n";
471
472 while (*cfpod == '\n')
473 buf << *cfpod++;
466 } 474 }
467 while (*cfpod == ' '); 475 while (*cfpod == ' ');
468 476
469 while (*cfpod == '\n')
470 buf << *cfpod++;
471
472 break; 477 break;
473 } 478 }
474} 479}
475 480
476dynbuf_text * 481dynbuf_text *

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines