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

Comparing deliantra/server/server/time.C (file contents):
Revision 1.13 by root, Sat Sep 16 22:24:13 2006 UTC vs.
Revision 1.14 by root, Thu Sep 21 18:58:39 2006 UTC

737 { 737 {
738 remove_ob (op); 738 remove_ob (op);
739 free_object (op); 739 free_object (op);
740 return; 740 return;
741 } 741 }
742
742 if (op->last_sp-- < 0) 743 if (op->last_sp-- < 0)
743 { 744 {
744 stop_arrow (op); 745 stop_arrow (op);
745 return; 746 return;
746 } 747 }
773 { 774 {
774 for (tmp = get_map_ob (m, new_x, new_y); tmp != NULL; tmp = tmp->above) 775 for (tmp = get_map_ob (m, new_x, new_y); tmp != NULL; tmp = tmp->above)
775 if (QUERY_FLAG (tmp, FLAG_ALIVE)) 776 if (QUERY_FLAG (tmp, FLAG_ALIVE))
776 break; 777 break;
777 778
778
779 /* Not really fair, but don't let monsters hit themselves with 779 /* Not really fair, but don't let monsters hit themselves with
780 * their own arrow - this can be because they fire it then 780 * their own arrow - this can be because they fire it then
781 * move into it. 781 * move into it.
782 */ 782 */
783
784 if (tmp != NULL && tmp != op->owner) 783 if (tmp && tmp != op->owner)
785 { 784 {
786 /* Found living object, but it is reflecting the missile. Update 785 /* Found living object, but it is reflecting the missile. Update
787 * as below. (Note that for living creatures there is a small 786 * as below. (Note that for living creatures there is a small
788 * chance that reflect_missile fails.) 787 * chance that reflect_missile fails.)
789 */ 788 */
790
791 if (QUERY_FLAG (tmp, FLAG_REFL_MISSILE) && (rndm (0, 99)) < (90 - op->level / 10)) 789 if (QUERY_FLAG (tmp, FLAG_REFL_MISSILE) && (rndm (0, 99)) < (90 - op->level / 10))
792 { 790 {
793
794 int number = op->face->number; 791 int number = op->face->number;
795 792
796 op->direction = absdir (op->direction + 4); 793 op->direction = absdir (op->direction + 4);
797 op->state = 0; 794 op->state = 0;
795
798 if (GET_ANIM_ID (op)) 796 if (GET_ANIM_ID (op))
799 { 797 {
800 number += 4; 798 number += 4;
799
801 if (number > GET_ANIMATION (op, 8)) 800 if (number > GET_ANIMATION (op, 8))
802 number -= 8; 801 number -= 8;
802
803 op->face = &new_faces[number]; 803 op->face = &new_faces[number];
804 } 804 }
805
805 was_reflected = 1; /* skip normal movement calculations */ 806 was_reflected = 1; /* skip normal movement calculations */
806 } 807 }
807 else 808 else
808 { 809 {
809 /* Attack the object. */ 810 /* Attack the object. */
810 op = hit_with_arrow (op, tmp); 811 op = hit_with_arrow (op, tmp);
812
811 if (op == NULL) 813 if (!op)
812 return; 814 return;
813 } 815 }
814 } /* if this is not hitting its owner */ 816 } /* if this is not hitting its owner */
815 } /* if there is something alive on this space */ 817 } /* if there is something alive on this space */
816
817 818
818 if (OB_TYPE_MOVE_BLOCK (op, GET_MAP_MOVE_BLOCK (m, new_x, new_y))) 819 if (OB_TYPE_MOVE_BLOCK (op, GET_MAP_MOVE_BLOCK (m, new_x, new_y)))
819 { 820 {
820 int retry = 0; 821 int retry = 0;
821 822

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines