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

Comparing deliantra/server/server/pets.C (file contents):
Revision 1.15 by root, Wed Dec 13 03:28:42 2006 UTC vs.
Revision 1.16 by root, Wed Dec 20 09:14:22 2006 UTC

117 nm = owner->map; 117 nm = owner->map;
118 /* Only look on the space if there is something alive there. */ 118 /* Only look on the space if there is something alive there. */
119 mflags = get_map_flags (nm, &nm, x, y, &x, &y); 119 mflags = get_map_flags (nm, &nm, x, y, &x, &y);
120 if (!(mflags & P_OUT_OF_MAP) && mflags & P_IS_ALIVE) 120 if (!(mflags & P_OUT_OF_MAP) && mflags & P_IS_ALIVE)
121 { 121 {
122 for (tmp = get_map_ob (nm, x, y); tmp != NULL; tmp = tmp->above) 122 for (tmp = GET_MAP_OB (nm, x, y); tmp != NULL; tmp = tmp->above)
123 { 123 {
124 object *tmp2 = tmp->head == NULL ? tmp : tmp->head; 124 object *tmp2 = tmp->head == NULL ? tmp : tmp->head;
125 125
126 if (QUERY_FLAG (tmp2, FLAG_ALIVE) && ((!QUERY_FLAG (tmp2, FLAG_FRIENDLY) && 126 if (QUERY_FLAG (tmp2, FLAG_ALIVE) && ((!QUERY_FLAG (tmp2, FLAG_FRIENDLY) &&
127 (tmp2->type != PLAYER)) || 127 (tmp2->type != PLAYER)) ||
189 nm = pet->map; 189 nm = pet->map;
190 /* Only look on the space if there is something alive there. */ 190 /* Only look on the space if there is something alive there. */
191 mflags = get_map_flags (nm, &nm, x, y, &x, &y); 191 mflags = get_map_flags (nm, &nm, x, y, &x, &y);
192 if (!(mflags & P_OUT_OF_MAP) && mflags & P_IS_ALIVE) 192 if (!(mflags & P_OUT_OF_MAP) && mflags & P_IS_ALIVE)
193 { 193 {
194 for (tmp = get_map_ob (nm, x, y); tmp != NULL; tmp = tmp->above) 194 for (tmp = GET_MAP_OB (nm, x, y); tmp != NULL; tmp = tmp->above)
195 { 195 {
196 object *tmp2 = tmp->head == NULL ? tmp : tmp->head; 196 object *tmp2 = tmp->head == NULL ? tmp : tmp->head;
197 197
198 if (QUERY_FLAG (tmp2, FLAG_ALIVE) && ((!QUERY_FLAG (tmp2, FLAG_FRIENDLY) && 198 if (QUERY_FLAG (tmp2, FLAG_ALIVE) && ((!QUERY_FLAG (tmp2, FLAG_FRIENDLY) &&
199 (tmp2->type != PLAYER)) || 199 (tmp2->type != PLAYER)) ||
400 dy = part->y + freearr_y[dir]; 400 dy = part->y + freearr_y[dir];
401 m = get_map_from_coord (part->map, &dx, &dy); 401 m = get_map_from_coord (part->map, &dx, &dy);
402 if (!m) 402 if (!m)
403 continue; 403 continue;
404 404
405 for (ob2 = get_map_ob (m, dx, dy); ob2 != NULL; ob2 = ob2->above) 405 for (ob2 = GET_MAP_OB (m, dx, dy); ob2 != NULL; ob2 = ob2->above)
406 { 406 {
407 object *new_ob; 407 object *new_ob;
408 408
409 new_ob = ob2->head ? ob2->head : ob2; 409 new_ob = ob2->head ? ob2->head : ob2;
410 if (new_ob == ob) 410 if (new_ob == ob)
590 mflags = get_map_flags (m, &m, x, y, &x, &y); 590 mflags = get_map_flags (m, &m, x, y, &x, &y);
591 591
592 if (mflags & P_OUT_OF_MAP) 592 if (mflags & P_OUT_OF_MAP)
593 continue; 593 continue;
594 594
595 for (victim = get_map_ob (op->map, x, y); victim; victim = victim->above) 595 for (victim = GET_MAP_OB (op->map, x, y); victim; victim = victim->above)
596 if (QUERY_FLAG (victim, FLAG_ALIVE)) 596 if (QUERY_FLAG (victim, FLAG_ALIVE))
597 break; 597 break;
598 598
599 /* We used to call will_hit_self to make sure we don't 599 /* We used to call will_hit_self to make sure we don't
600 * hit ourselves, but that didn't work, and I don't really 600 * hit ourselves, but that didn't work, and I don't really

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines