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

Comparing deliantra/server/server/disease.C (file contents):
Revision 1.18 by root, Sat Jan 20 22:09:54 2007 UTC vs.
Revision 1.19 by root, Mon Feb 5 02:07:40 2007 UTC

237{ 237{
238 object *walk; 238 object *walk;
239 239
240 /* check the inventory for symptoms */ 240 /* check the inventory for symptoms */
241 for (walk = disease->env->inv; walk; walk = walk->below) 241 for (walk = disease->env->inv; walk; walk = walk->below)
242 if (!strcmp (walk->name, disease->name) && walk->type == SYMPTOM) 242 if (walk->name == disease->name && walk->type == SYMPTOM)
243 return walk; 243 return walk;
244 return NULL; 244 return NULL;
245} 245}
246 246
247/* searches around for more victims to infect */ 247/* searches around for more victims to infect */
325 * if you diseased, you can't get diseased more. 325 * if you diseased, you can't get diseased more.
326 */ 326 */
327 327
328 for ( /* tmp initialised in if, above */ ; tmp; tmp = tmp->below) 328 for ( /* tmp initialised in if, above */ ; tmp; tmp = tmp->below)
329 { 329 {
330 if (tmp->type == SIGN && !strcmp (tmp->name, disease->name) && tmp->level >= disease->level) 330 if (tmp->type == SIGN && tmp->name == disease->name && tmp->level >= disease->level)
331 return 0; /* Immune! */ 331 return 0; /* Immune! */
332 else if (tmp->type == DISEASE && !strcmp (tmp->name, disease->name)) 332 else if (tmp->type == DISEASE && tmp->name == disease->name)
333 return 0; /* already diseased */ 333 return 0; /* already diseased */
334 } 334 }
335 335
336 /* If we've gotten this far, go ahead and infect the victim. */ 336 /* If we've gotten this far, go ahead and infect the victim. */
337 new_disease = disease->clone (); 337 new_disease = disease->clone ();
435 tmp = victim->inv; 435 tmp = victim->inv;
436 436
437 for ( /* tmp initialised in if, above */ ; tmp; tmp = tmp->below) 437 for ( /* tmp initialised in if, above */ ; tmp; tmp = tmp->below)
438 { 438 {
439 if (tmp->type == SIGN) /* possibly an immunity, or diseased */ 439 if (tmp->type == SIGN) /* possibly an immunity, or diseased */
440 if (!strcmp (tmp->name, disease->name) && tmp->level >= disease->level) 440 if (tmp->name == disease->name && tmp->level >= disease->level)
441 return 0; /*Immune! */ 441 return 0; /*Immune! */
442 } 442 }
443 443
444 new_symptom = get_archetype (ARCH_SYMPTOM); 444 new_symptom = get_archetype (ARCH_SYMPTOM);
445 445
541 if (disease->last_heal) 541 if (disease->last_heal)
542 return 0; 542 return 0;
543 /* first, search for an immunity of the same name */ 543 /* first, search for an immunity of the same name */
544 for (walk = disease->env->inv; walk; walk = walk->below) 544 for (walk = disease->env->inv; walk; walk = walk->below)
545 { 545 {
546 if (walk->type == 98 && !strcmp (disease->name, walk->name)) 546 if (walk->type == 98 && disease->name == walk->name)
547 { 547 {
548 walk->level = disease->level; 548 walk->level = disease->level;
549 return 1; /* just update the existing immunity. */ 549 return 1; /* just update the existing immunity. */
550 } 550 }
551 } 551 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines