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.12 by root, Sun Oct 15 02:16:34 2006 UTC vs.
Revision 1.15 by elmex, Tue Dec 19 13:41:45 2006 UTC

771 tmp->attack_movement = 0; 771 tmp->attack_movement = 0;
772 /* lots of checks here, but want to make sure we don't 772 /* lots of checks here, but want to make sure we don't
773 * dereference a null value 773 * dereference a null value
774 */ 774 */
775 if (tmp->type == GOLEM && tmp->owner && tmp->owner->type == PLAYER && tmp->owner->contr->ranges[range_golem] == tmp) 775 if (tmp->type == GOLEM && tmp->owner && tmp->owner->type == PLAYER && tmp->owner->contr->ranges[range_golem] == tmp)
776 {
777 tmp->owner->contr->ranges[range_golem] = NULL; 776 tmp->owner->contr->ranges[range_golem] = 0;
778 tmp->owner->contr->golem_count = 0; 777
779 }
780 tmp->owner = 0; 778 tmp->owner = 0;
781 } 779 }
782 break; 780 break;
783 case 1: /* angry -- get neutral monsters mad */ 781 case 1: /* angry -- get neutral monsters mad */
784 if (QUERY_FLAG (tmp, FLAG_UNAGGRESSIVE) && !QUERY_FLAG (tmp, FLAG_FRIENDLY)) 782 if (QUERY_FLAG (tmp, FLAG_UNAGGRESSIVE) && !QUERY_FLAG (tmp, FLAG_FRIENDLY))
801 if (tmp2->above == NULL) 799 if (tmp2->above == NULL)
802 break; 800 break;
803 801
804 if (tmp2->type != PLAYER) 802 if (tmp2->type != PLAYER)
805 break; 803 break;
806 set_owner (tmp, tmp2); 804 tmp->set_owner (tmp2);
807 SET_FLAG (tmp, FLAG_MONSTER); 805 SET_FLAG (tmp, FLAG_MONSTER);
808 tmp->stats.exp = 0; 806 tmp->stats.exp = 0;
809 SET_FLAG (tmp, FLAG_FRIENDLY); 807 SET_FLAG (tmp, FLAG_FRIENDLY);
810 add_friendly_object (tmp); 808 add_friendly_object (tmp);
811 tmp->attack_movement = PETMOVE; 809 tmp->attack_movement = PETMOVE;
856 * last_heal = 1/0 remove/dont remove obj if triggered 854 * last_heal = 1/0 remove/dont remove obj if triggered
857 * -b.t. (thomas@nomad.astro.psu.edu 855 * -b.t. (thomas@nomad.astro.psu.edu
858 */ 856 */
859 857
860void 858void
861check_inv (object *op, object *trig) 859check_inv (object *op, object *trig, bool move_on)
862{ 860{
863 object *match; 861 object *match;
864 862
865 if (op->type != PLAYER) 863 if (op->type != PLAYER)
866 return; 864 return;
867 match = check_inv_recursive (op, trig); 865 match = check_inv_recursive (op, trig);
868 if (match && trig->last_sp) 866 if (match && trig->last_sp)
869 { 867 {
870 if (trig->last_heal) 868 if (trig->last_heal)
871 decrease_ob (match); 869 decrease_ob (match);
872 use_trigger (trig); 870
871 trig->value = move_on ? 1 : 0;
872
873 push_button (trig);
873 } 874 }
874 else if (!match && !trig->last_sp) 875 else if (!match && !trig->last_sp)
875 use_trigger (trig); 876 {
877 trig->value = move_on ? 1 : 0;
878 push_button (trig);
879 }
876} 880}
877 881

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines