--- deliantra/server/server/spell_attack.C 2008/05/17 14:57:23 1.58 +++ deliantra/server/server/spell_attack.C 2008/05/18 19:53:07 1.61 @@ -150,6 +150,7 @@ new_bolt->stats.dam++; tmp->stats.dam /= 2; /* reduce father bolt damage */ tmp->stats.dam++; + if ((new_bolt = m->insert (new_bolt, sx, sy, op))) update_turn_face (new_bolt); } @@ -1612,7 +1613,6 @@ * op is the spell effect. * note that duration is handled by process_object() in time.c */ - void move_ball_spell (object *op) { @@ -1732,6 +1732,13 @@ #endif object *owner = op->env; + if (!owner) // MUST not happen, remove when true TODO + { + LOG (llevError, "swarm spell found outside inventory: %s\n", op->debug_desc ()); + op->destroy (); + return; + } + if (!op->duration || !owner->is_on_map ()) { op->destroy (); @@ -1742,8 +1749,11 @@ int basedir = op->direction; if (!basedir) - /* spray in all directions! 8) */ - basedir = (op->facing += op->state) % 8 + 1; + { + /* spray in all directions! 8) */ + op->facing = (op->facing + op->state) & 7; + basedir = op->facing + 1; + } #if 0 // this is bogus: it causes wrong places to be checked below @@ -1835,6 +1845,7 @@ return 0; object *tmp = archetype::get (SWARM_SPELL); + set_spell_skill (op, caster, spell, tmp); tmp->level = caster_level (caster, spell); /* needed later, to get level dep. right. */ tmp->spell = spell->other_arch->instance (); @@ -1848,8 +1859,9 @@ for (int i = 0; i < spell->duration; i++) tmp->duration += die_roll (1, 3, op, PREFER_HIGH); - tmp->direction = dir; tmp->invisible = 1; + tmp->flag [FLAG_NO_DROP] = 1; // make sure it stays in inv, or else + tmp->direction = dir; tmp->facing = rndm (1, 8); // initial firing direction tmp->state = rndm (4) * 2 + 1; // direction increment