--- deliantra/server/server/spell_attack.C 2006/09/14 22:34:05 1.13 +++ deliantra/server/server/spell_attack.C 2006/09/16 22:24:13 1.15 @@ -119,7 +119,7 @@ { int new_dir = 1; /* direction or -1 for left, +1 for right 0 if no new bolt */ int t_dir; /* stores temporary dir calculation */ - mapstruct *m; + maptile *m; sint16 sx, sy; object *new_bolt; @@ -172,7 +172,7 @@ object *tmp; int mflags; sint16 x, y; - mapstruct *m; + maptile *m; if (--(op->duration) < 0) { @@ -358,7 +358,7 @@ explosion (object *op) { object *tmp; - mapstruct *m = op->map; + maptile *m = op->map; int i; if (--(op->duration) < 0) @@ -404,7 +404,6 @@ void explode_bullet (object *op) { - tag_t op_tag = op->count; object *tmp, *owner; if (op->other_arch == NULL) @@ -453,7 +452,7 @@ if (op->attacktype) { hit_map (op, 0, op->attacktype, 1); - if (was_destroyed (op, op_tag)) + if (op->destroyed ()) return; } @@ -506,7 +505,7 @@ insert_ob_in_map (tmp, op->map, op, 0); /* remove the firebullet */ - if (!was_destroyed (op, op_tag)) + if (!op->destroyed ()) { remove_ob (op); free_object (op); @@ -522,10 +521,9 @@ void check_bullet (object *op) { - tag_t op_tag = op->count, tmp_tag; object *tmp; int dam, mflags; - mapstruct *m; + maptile *m; sint16 sx, sy; mflags = get_map_flags (op->map, &m, op->x, op->y, &sx, &sy); @@ -548,9 +546,8 @@ { if (QUERY_FLAG (tmp, FLAG_ALIVE)) { - tmp_tag = tmp->count; dam = hit_player (tmp, op->stats.dam, op, op->attacktype, 1); - if (was_destroyed (op, op_tag) || !was_destroyed (tmp, tmp_tag) || (op->stats.dam -= dam) < 0) + if (op->destroyed () || !tmp->destroyed () || (op->stats.dam -= dam) < 0) { if (!QUERY_FLAG (op, FLAG_REMOVED)) { @@ -575,7 +572,7 @@ { sint16 new_x, new_y; int mflags; - mapstruct *m; + maptile *m; #if 0 /* We need a better general purpose way to do this */ @@ -585,7 +582,7 @@ if (op->stats.sp == SP_METEOR) { replace_insert_ob_in_map ("fire_trail", op); - if (was_destroyed (op, op_tag)) + if (op->destroyed ()) return; } /* end addition. */ #endif @@ -758,7 +755,6 @@ move_cone (object *op) { int i; - tag_t tag; /* if no map then hit_map will crash so just ignore object */ if (!op->map) @@ -789,7 +785,6 @@ } #endif - tag = op->count; hit_map (op, 0, op->attacktype, 0); /* Check to see if we should push anything. @@ -799,7 +794,7 @@ if (op->weight) check_spell_knockback (op); - if (was_destroyed (op, tag)) + if (op->destroyed ()) return; if ((op->duration--) < 0) @@ -854,7 +849,7 @@ { object *tmp; int i, success = 0, range_min = -1, range_max = 1; - mapstruct *m; + maptile *m; sint16 sx, sy; MoveType movetype; @@ -1077,7 +1072,7 @@ object *tmp; int mflags; sint16 dx = op->x + freearr_x[dir], dy = op->y + freearr_y[dir]; - mapstruct *m; + maptile *m; mflags = get_map_flags (op->map, &m, dx, dy, &dx, &dy); if ((mflags & P_OUT_OF_MAP) || (GET_MAP_MOVE_BLOCK (m, dx, dy) & MOVE_WALK)) @@ -1123,7 +1118,7 @@ object *target; sint16 x, y; int dist, mflags; - mapstruct *mp; + maptile *mp; if (dir == 0) return NULL; @@ -1273,7 +1268,7 @@ int i, mflags; object *owner; sint16 new_x, new_y; - mapstruct *m; + maptile *m; if (op->range-- <= 0) { @@ -1302,26 +1297,24 @@ if (!(mflags & P_OUT_OF_MAP) && ((mflags & P_IS_ALIVE) || OB_TYPE_MOVE_BLOCK (op, GET_MAP_MOVE_BLOCK (m, new_x, new_y)))) { - tag_t tag = op->count; - hit_map (op, op->direction, AT_MAGIC, 1); /* Basically, missile only hits one thing then goes away. * we need to remove it if someone hasn't already done so. */ - if (!was_destroyed (op, tag)) - { - remove_ob (op); - free_object (op); - } + if (!op->destroyed ()) + free_object (op); + return; } remove_ob (op); + if (!op->direction || (mflags & P_OUT_OF_MAP)) { free_object (op); return; } + op->x = new_x; op->y = new_y; op->map = m; @@ -1331,6 +1324,7 @@ op->direction = i; SET_ANIMATION (op, op->direction); } + insert_ob_in_map (op, op->map, op, 0); } @@ -1386,7 +1380,7 @@ { int i, j, range, mflags, friendly = 0, dam, dur; sint16 sx, sy; - mapstruct *m; + maptile *m; object *tmp; const char *skill; @@ -1578,7 +1572,7 @@ object *tmp, *god, *head; int done_one, range, mflags, level, at, best_at; sint16 x, y, nx, ny; - mapstruct *m; + maptile *m; const char *race; /* We precompute some values here so that we don't have to keep @@ -1752,7 +1746,7 @@ int i, j, dam_save, dir, mflags; sint16 nx, ny, hx, hy; object *owner; - mapstruct *m; + maptile *m; owner = get_owner (op); @@ -1874,7 +1868,7 @@ static int diagonal_adjust[10] = { -3, -2, -2, -1, 0, 0, 1, 2, 2, 3 }; sint16 target_x, target_y, origin_x, origin_y; int adjustdir; - mapstruct *m; + maptile *m; #endif int basedir; object *owner; @@ -2027,7 +2021,7 @@ object *target = NULL, *tmp = NULL; sint16 x, y; int dam, mflags; - mapstruct *m; + maptile *m; dam = spell->stats.dam + SP_level_dam_adjust (caster, spell); @@ -2105,7 +2099,7 @@ sint16 x, y; int i, mflags, range, dam_mod, dur_mod; object *walk; - mapstruct *m; + maptile *m; x = op->x; y = op->y;