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

Comparing deliantra/server/common/object.C (file contents):
Revision 1.147 by root, Sat May 12 16:06:42 2007 UTC vs.
Revision 1.150 by root, Tue May 15 19:07:15 2007 UTC

450 owner = owner->owner; 450 owner = owner->owner;
451 451
452 this->owner = owner; 452 this->owner = owner;
453} 453}
454 454
455int
456object::slottype () const
457{
458 if (type == SKILL)
459 {
460 if (IS_COMBAT_SKILL (subtype)) return slot_combat;
461 if (IS_RANGED_SKILL (subtype)) return slot_ranged;
462 }
463 else
464 {
465 if (slot [body_combat].info) return slot_combat;
466 if (slot [body_range ].info) return slot_ranged;
467 }
468
469 return slot_none;
470}
471
455bool 472bool
456object::change_weapon (object *ob) 473object::change_weapon (object *ob)
457{ 474{
458 if (current_weapon == ob) 475 if (current_weapon == ob)
459 return true; 476 return true;
464 current_weapon = ob; 481 current_weapon = ob;
465 chosen_skill = !ob || ob->type == SKILL ? ob : find_skill_by_name (this, ob->skill); 482 chosen_skill = !ob || ob->type == SKILL ? ob : find_skill_by_name (this, ob->skill);
466 483
467 if (chosen_skill) 484 if (chosen_skill)
468 chosen_skill->flag [FLAG_APPLIED] = true; 485 chosen_skill->flag [FLAG_APPLIED] = true;
486
487 if (ob && !ob->flag [FLAG_APPLIED])
488 {
489 LOG (llevError | logBacktrace, "%s changed to unapplied weapon %s",
490 &name, ob->debug_desc ());
491 return false;
492 }
469 493
470 update_stats (); 494 update_stats ();
471 495
472 if (ob) 496 if (ob)
473 { 497 {
483 "You try to balance your applied items all at once, but the %s is too much. " 507 "You try to balance your applied items all at once, but the %s is too much. "
484 "You need to unapply some items first.", &ob->name); 508 "You need to unapply some items first.", &ob->name);
485 return false; 509 return false;
486 } 510 }
487 511
488 new_draw_info_format (NDI_UNIQUE, 0, this, "You switch to your %s.", &ob->name); 512 //new_draw_info_format (NDI_UNIQUE, 0, this, "You switch to your %s.", &ob->name);
489 } 513 }
490 else 514 else
491 new_draw_info_format (NDI_UNIQUE, 0, this, "You unwield your weapons."); 515 ;//new_draw_info_format (NDI_UNIQUE, 0, this, "You unwield your weapons.");
492 516
493 return true; 517 return true;
494} 518}
495 519
496/* Zero the key_values on op, decrementing the shared-string 520/* Zero the key_values on op, decrementing the shared-string

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines