--- deliantra/server/server/spell_attack.C 2008/09/29 06:32:09 1.64 +++ deliantra/server/server/spell_attack.C 2008/09/29 10:31:32 1.66 @@ -167,7 +167,7 @@ if (--op->duration < 0) { - op->destroy (); + op->drop_and_destroy (); return; } @@ -309,7 +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 (); + tmp->drop_and_destroy (); return 0; } @@ -319,7 +319,7 @@ { if (!QUERY_FLAG (tmp, FLAG_REFLECTING)) { - tmp->destroy (); + tmp->drop_and_destroy (); return 0; } @@ -353,7 +353,7 @@ if (--op->duration < 0) { - op->destroy (); + op->destroy (true); return; } @@ -398,7 +398,7 @@ if (!op->other_arch) { LOG (llevError, "BUG: explode_bullet(): op without other_arch\n"); - op->destroy (); + op->destroy (true); return; } @@ -409,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 (); + op->destroy (true); return; } @@ -418,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 (); + op->destroy (true); return; } @@ -427,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 (); + op->destroy (true); return; } @@ -447,9 +447,12 @@ owner = op->owner; - if ((tmp->attacktype & AT_HOLYWORD || tmp->attacktype & AT_GODPOWER) && owner && !tailor_god_spell (tmp, owner)) + if ((tmp->attacktype & AT_HOLYWORD + || tmp->attacktype & AT_GODPOWER) + && owner + && !tailor_god_spell (tmp, owner)) { - op->destroy (); + op->destroy (true); return; } @@ -487,7 +490,7 @@ tmp->play_sound (tmp->sound); /* remove the firebullet */ - op->destroy (); + op->destroy (true); } /* checks to see what op should do, given the space it is on @@ -523,11 +526,12 @@ { dam = hit_player (tmp, op->stats.dam, op, op->attacktype, 1); + // TODO: can't understand the following if's if (op->destroyed () || !tmp->destroyed () || (op->stats.dam -= dam) < 0) { if (!QUERY_FLAG (op, FLAG_REMOVED)) { - op->destroy (); + op->destroy (true); return; } } @@ -566,7 +570,7 @@ if (op->other_arch) explode_bullet (op); else - op->destroy (); + op->destroy (true); return; } @@ -578,7 +582,7 @@ if (mflags & P_OUT_OF_MAP) { - op->destroy (); + op->destroy (true); return; } @@ -587,7 +591,7 @@ if (op->other_arch) explode_bullet (op); else - op->destroy (); + op->destroy (true); return; } @@ -653,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 (); + tmp->destroy (true); return 0; } @@ -663,7 +667,7 @@ { if (!QUERY_FLAG (tmp, FLAG_REFLECTING)) { - tmp->destroy (); + tmp->destroy (true); return 0; } @@ -728,7 +732,7 @@ /* If no owner left, the spell dies out. */ if (op->owner == NULL) { - op->destroy (); + op->destroy (true); return; } #endif @@ -747,7 +751,7 @@ if (op->duration-- < 0) { - op->destroy (); + op->destroy (true); return; } /* Object has hit maximum range, so don't have it move @@ -956,7 +960,7 @@ // as bombs can be carried. if (get_map_flags (op->map, NULL, op->x, op->y, NULL, NULL) & P_SAFE) { - op->destroy (); + op->destroy (true); return; } @@ -1148,7 +1152,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 (); + effect->destroy (true); return 0; } } @@ -1181,7 +1185,7 @@ { if (op->range-- <= 0) { - op->destroy (); + op->drop_and_destroy (); return; } @@ -1190,7 +1194,7 @@ if (!pos.normalise ()) { - op->destroy (); + op->destroy (true); return; } @@ -1202,13 +1206,13 @@ /* Basically, missile only hits one thing then goes away. * we need to remove it if someone hasn't already done so. */ - op->destroy (); + op->destroy (true); return; } if (!op->direction) { - op->destroy (); + op->destroy (true); return; } @@ -1735,13 +1739,13 @@ if (!owner) // MUST not happen, remove when true TODO { LOG (llevError, "swarm spell found outside inventory: %s\n", op->debug_desc ()); - op->destroy (); + op->destroy (true); return; } if (!op->duration || !owner->is_on_map ()) { - op->destroy (); + op->drop_and_destroy (); return; } @@ -2054,12 +2058,12 @@ { new_draw_info_format (NDI_UNIQUE, 0, op, "You inflict %s on %s!", &disease->name, &walk->name); - disease->destroy (); /* don't need this one anymore */ + disease->destroy (true); /* don't need this one anymore */ walk->map->insert (get_archetype ("detect_magic"), x, y, op); return 1; } - disease->destroy (); + disease->destroy (true); } } /* if living creature */ } /* for range of spaces */