--- deliantra/server/server/spell_attack.C 2008/09/29 10:20:49 1.65 +++ deliantra/server/server/spell_attack.C 2008/10/06 08:46:33 1.68 @@ -167,8 +167,7 @@ if (--op->duration < 0) { - op->destroy_inv (true); // be explicit about dropping - op->destroy (true); + op->drop_and_destroy (); return; } @@ -310,8 +309,7 @@ mflags = get_map_flags (tmp->map, &newmap, tmp->x, tmp->y, &tmp->x, &tmp->y); if (mflags & P_OUT_OF_MAP) { - tmp->destroy_inv (true); // be explicit about dropping - tmp->destroy (true); + tmp->drop_and_destroy (); return 0; } @@ -321,8 +319,7 @@ { if (!QUERY_FLAG (tmp, FLAG_REFLECTING)) { - tmp->destroy_inv (true); // be explicit about dropping - tmp->destroy (true); + tmp->drop_and_destroy (); return 0; } @@ -356,7 +353,7 @@ if (--op->duration < 0) { - op->destroy (true); + op->destroy (); return; } @@ -401,7 +398,7 @@ if (!op->other_arch) { LOG (llevError, "BUG: explode_bullet(): op without other_arch\n"); - op->destroy (true); + op->destroy (); return; } @@ -412,7 +409,7 @@ if (!env->map || out_of_map (env->map, env->x, env->y)) { LOG (llevError, "BUG: explode_bullet(): env out of map\n"); - op->destroy (true); + op->destroy (); return; } @@ -421,7 +418,7 @@ else if (out_of_map (op->map, op->x, op->y)) { LOG (llevError, "BUG: explode_bullet(): op out of map\n"); - op->destroy (true); + op->destroy (); return; } @@ -430,7 +427,7 @@ // bad at the moment that might happen from this. if (get_map_flags (op->map, NULL, op->x, op->y, NULL, NULL) & P_SAFE) { - op->destroy (true); + op->destroy (); return; } @@ -455,7 +452,7 @@ && owner && !tailor_god_spell (tmp, owner)) { - op->destroy (true); + op->destroy (); return; } @@ -493,7 +490,7 @@ tmp->play_sound (tmp->sound); /* remove the firebullet */ - op->destroy (true); + op->destroy (); } /* checks to see what op should do, given the space it is on @@ -534,7 +531,7 @@ { if (!QUERY_FLAG (op, FLAG_REMOVED)) { - op->destroy (true); + op->destroy (); return; } } @@ -573,7 +570,7 @@ if (op->other_arch) explode_bullet (op); else - op->destroy (true); + op->destroy (); return; } @@ -585,7 +582,7 @@ if (mflags & P_OUT_OF_MAP) { - op->destroy (true); + op->destroy (); return; } @@ -594,7 +591,7 @@ if (op->other_arch) explode_bullet (op); else - op->destroy (true); + op->destroy (); return; } @@ -660,7 +657,7 @@ mflags = get_map_flags (tmp->map, &newmap, tmp->x, tmp->y, &tmp->x, &tmp->y); if (mflags & P_OUT_OF_MAP) { - tmp->destroy (true); + tmp->destroy (); return 0; } @@ -670,7 +667,7 @@ { if (!QUERY_FLAG (tmp, FLAG_REFLECTING)) { - tmp->destroy (true); + tmp->destroy (); return 0; } @@ -735,26 +732,31 @@ /* If no owner left, the spell dies out. */ if (op->owner == NULL) { - op->destroy (true); + op->destroy (); return; } #endif hit_map (op, 0, op->attacktype, 0); + if (!op->is_on_map ()) + return; + /* Check to see if we should push anything. * Spell objects with weight push whatever they encounter to some * degree. */ if (op->weight) - check_spell_knockback (op); + { + check_spell_knockback (op); - if (op->destroyed ()) - return; + if (!op->is_on_map ()) + return; + } if (op->duration-- < 0) { - op->destroy (true); + op->destroy (); return; } /* Object has hit maximum range, so don't have it move @@ -963,7 +965,7 @@ // as bombs can be carried. if (get_map_flags (op->map, NULL, op->x, op->y, NULL, NULL) & P_SAFE) { - op->destroy (true); + op->destroy (); return; } @@ -1155,7 +1157,7 @@ { new_draw_info_format (NDI_UNIQUE, 0, op, "The %s looks stronger!", query_name (target)); target->stats.hp = target->stats.maxhp * 2; - effect->destroy (true); + effect->destroy (); return 0; } } @@ -1188,8 +1190,7 @@ { if (op->range-- <= 0) { - op->destroy_inv (true); // be explicit about dropping - op->destroy (true); + op->drop_and_destroy (); return; } @@ -1198,7 +1199,7 @@ if (!pos.normalise ()) { - op->destroy (true); + op->destroy (); return; } @@ -1210,13 +1211,13 @@ /* Basically, missile only hits one thing then goes away. * we need to remove it if someone hasn't already done so. */ - op->destroy (true); + op->destroy (); return; } if (!op->direction) { - op->destroy (true); + op->destroy (); return; } @@ -1743,14 +1744,13 @@ if (!owner) // MUST not happen, remove when true TODO { LOG (llevError, "swarm spell found outside inventory: %s\n", op->debug_desc ()); - op->destroy (true); + op->destroy (); return; } if (!op->duration || !owner->is_on_map ()) { - op->destroy_inv (true); // be explicit about dropping - op->destroy (true); + op->drop_and_destroy (); return; } @@ -2063,12 +2063,12 @@ { new_draw_info_format (NDI_UNIQUE, 0, op, "You inflict %s on %s!", &disease->name, &walk->name); - disease->destroy (true); /* don't need this one anymore */ + disease->destroy (); /* don't need this one anymore */ walk->map->insert (get_archetype ("detect_magic"), x, y, op); return 1; } - disease->destroy (true); + disease->destroy (); } } /* if living creature */ } /* for range of spaces */