--- deliantra/server/server/spell_attack.C 2009/11/29 17:41:08 1.93 +++ deliantra/server/server/spell_attack.C 2009/12/18 03:49:46 1.94 @@ -1294,28 +1294,32 @@ mapspace &ms = m->at (nx, ny); if (ms.flags () & P_IS_ALIVE) - for (object *tmp = ms.bot; tmp; tmp = tmp->above) - if (tmp->flag [FLAG_ALIVE] || tmp->is_player ()) - { - tmp = tmp->head_ (); + for (object *next, *tmp = ms.bot; tmp; tmp = next) + { + next = tmp->above; - if ((friendly && !tmp->flag [FLAG_FRIENDLY] && !tmp->is_player ()) - || (!friendly && (tmp->flag [FLAG_FRIENDLY] || tmp->is_player ()))) - { - if (spell_ob->subtype == SP_DESTRUCTION) - { - hit_player (tmp, dam, op, spell_ob->attacktype, 0); + if (tmp->flag [FLAG_ALIVE] || tmp->is_player ()) + { + tmp = tmp->head_ (); - if (spell_ob->other_arch) - m->insert (spell_ob->other_arch->instance (), nx, ny, op); - } - else if (spell_ob->subtype == SP_FAERY_FIRE && tmp->resist [ATNR_MAGIC] != 100) - { - if (make_object_glow (tmp, 1, dur) && spell_ob->other_arch) - m->insert (spell_ob->other_arch->instance (), nx, ny, op); - } - } - } + if ((friendly && !tmp->flag [FLAG_FRIENDLY] && !tmp->is_player ()) + || (!friendly && (tmp->flag [FLAG_FRIENDLY] || tmp->is_player ()))) + { + if (spell_ob->subtype == SP_DESTRUCTION) + { + hit_player (tmp, dam, op, spell_ob->attacktype, 0); + + if (spell_ob->other_arch) + m->insert (spell_ob->other_arch->instance (), nx, ny, op); + } + else if (spell_ob->subtype == SP_FAERY_FIRE && tmp->resist [ATNR_MAGIC] != 100) + { + if (make_object_glow (tmp, 1, dur) && spell_ob->other_arch) + m->insert (spell_ob->other_arch->instance (), nx, ny, op); + } + } + } + } } op->skill = skill;