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

Comparing deliantra/server/common/button.C (file contents):
Revision 1.28 by root, Mon Jan 29 15:36:25 2007 UTC vs.
Revision 1.30 by root, Sat Apr 28 17:51:57 2007 UTC

1/* 1/*
2 * CrossFire, A Multiplayer game for X-windows 2 * CrossFire, A Multiplayer game
3 * 3 *
4 * Copyright (C) 2005, 2006, 2007 Marc Lehmann & Crossfire+ Development Team 4 * Copyright (C) 2005, 2006, 2007 Marc Lehmann & Crossfire+ Development Team
5 * Copyright (C) 2002 Mark Wedel & Crossfire Development Team 5 * Copyright (C) 2002 Mark Wedel & Crossfire Development Team
6 * Copyright (C) 1992 Frank Tore Johansen 6 * Copyright (C) 1992 Frank Tore Johansen
7 * 7 *
734 if (QUERY_FLAG (tmp, FLAG_UNAGGRESSIVE)) 734 if (QUERY_FLAG (tmp, FLAG_UNAGGRESSIVE))
735 CLEAR_FLAG (tmp, FLAG_UNAGGRESSIVE); 735 CLEAR_FLAG (tmp, FLAG_UNAGGRESSIVE);
736 736
737 if (QUERY_FLAG (tmp, FLAG_FRIENDLY)) 737 if (QUERY_FLAG (tmp, FLAG_FRIENDLY))
738 { 738 {
739 remove_friendly_object (tmp);
740
741 tmp->attack_movement = 0; 739 tmp->attack_movement = 0;
742 /* lots of checks here, but want to make sure we don't 740 /* lots of checks here, but want to make sure we don't
743 * dereference a null value 741 * dereference a null value
744 */ 742 */
745 if (tmp->type == GOLEM && tmp->owner && tmp->owner->type == PLAYER && tmp->owner->contr->ranges[range_golem] == tmp) 743 if (tmp->type == GOLEM
744 && tmp->owner
745 && tmp->owner->type == PLAYER
746 && tmp->owner->contr->ranges[range_golem] == tmp)
746 tmp->owner->contr->ranges[range_golem] = 0; 747 tmp->owner->contr->ranges[range_golem] = 0;
747 748
748 tmp->owner = 0; 749 tmp->owner = 0;
750
751 remove_friendly_object (tmp);
749 } 752 }
750 break; 753 break;
751 754
752 case 1: /* angry -- get neutral monsters mad */ 755 case 1: /* angry -- get neutral monsters mad */
753 if (QUERY_FLAG (tmp, FLAG_UNAGGRESSIVE) && !QUERY_FLAG (tmp, FLAG_FRIENDLY)) 756 if (QUERY_FLAG (tmp, FLAG_UNAGGRESSIVE) && !QUERY_FLAG (tmp, FLAG_FRIENDLY))
776 add_friendly_object (tmp); 779 add_friendly_object (tmp);
777 tmp->attack_movement = PETMOVE; 780 tmp->attack_movement = PETMOVE;
778 } 781 }
779 break; 782 break;
780 783
781 case 6: 784 case 6: // kill monsters
782 if (!QUERY_FLAG (tmp, FLAG_FRIENDLY)) 785 if (!QUERY_FLAG (tmp, FLAG_FRIENDLY))
783 break; 786 break;
784 787
785 // FALL THROUGH 788 // FALL THROUGH
786 case 5: 789 case 5: // kill all alives
790 if (!tmp->flag [FLAG_PRECIOUS])
791 {
787 get_archetype ("burnout")->insert_at (tmp, source); 792 get_archetype ("burnout")->insert_at (tmp, source);
788 tmp->destroy (); 793 tmp->destroy ();
794 }
789 break; 795 break;
790 796
791 default: 797 default:
792 break; 798 break;
793 } 799 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines