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.317 by root, Fri Apr 2 03:41:24 2010 UTC vs.
Revision 1.318 by root, Sat Apr 3 02:27:24 2010 UTC

589 if (slot [body_combat].info) return slot_combat; 589 if (slot [body_combat].info) return slot_combat;
590 if (slot [body_range ].info) return slot_ranged; 590 if (slot [body_range ].info) return slot_ranged;
591 } 591 }
592 592
593 return slot_none; 593 return slot_none;
594}
595
596bool
597object::change_weapon (object *ob)
598{
599 if (current_weapon == ob)
600 return true;
601
602 if (current_weapon && current_weapon->flag [FLAG_APPLIED])
603 {
604 manual_apply (this, current_weapon, AP_UNAPPLY);
605
606 if (current_weapon && !current_weapon->flag [FLAG_APPLIED])//D
607 LOG (llevError, "FATAL: did not clear current_weapon (%s)\n", current_weapon->debug_desc ());
608
609 if (current_weapon && current_weapon->flag [FLAG_APPLIED])
610 return false;
611 }
612
613 current_weapon = 0;
614
615 if (ob && !ob->flag [FLAG_APPLIED])
616 {
617 manual_apply (this, ob, AP_APPLY);
618
619 if (ob->flag [FLAG_APPLIED])
620 current_weapon = ob;
621 else
622 return false;
623 }
624
625 return true;
626} 594}
627 595
628/* Zero the key_values on op, decrementing the shared-string 596/* Zero the key_values on op, decrementing the shared-string
629 * refcounts and freeing the links. 597 * refcounts and freeing the links.
630 */ 598 */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines