--- deliantra/server/server/spell_effect.C 2007/08/29 20:40:25 1.71 +++ deliantra/server/server/spell_effect.C 2007/08/31 00:20:41 1.72 @@ -2212,7 +2212,6 @@ return 1; } - /* move aura function. An aura is a part of someone's inventory, * which he carries with him, but which acts on the map immediately * around him. @@ -2221,16 +2220,12 @@ * attacktype: aura's attacktype * other_arch: archetype to drop where we attack */ - void move_aura (object *aura) { - int i, mflags; - object *env; - maptile *m; - /* auras belong in inventories */ - env = aura->env; + object *env = aura->env; + object *owner = aura->owner; /* no matter what we've gotta remove the aura... * we'll put it back if its time isn't up. @@ -2245,7 +2240,7 @@ } /* auras only exist in inventories */ - if (env == NULL || env->map == NULL) + if (!env || !env->map) { aura->destroy (); return; @@ -2256,30 +2251,27 @@ */ aura->insert_at (env, aura); - for (i = 1; i < 9; i++) + for (int i = 1; i < 9; i++) { - sint16 nx, ny; + mapxy pos (env); + pos.move (i); - nx = aura->x + freearr_x[i]; - ny = aura->y + freearr_y[i]; - mflags = get_map_flags (env->map, &m, nx, ny, &nx, &ny); - - /* Consider the movement tyep of the person with the aura as - * movement type of the aura. Eg, if the player is flying, the aura + /* Consider the movement type of the person with the aura as + * movement type of the aura. Eg, if the player is flying, the aura * is flying also, if player is walking, it is on the ground, etc. */ - if (!(mflags & P_OUT_OF_MAP) && !(OB_TYPE_MOVE_BLOCK (env, GET_MAP_MOVE_BLOCK (m, nx, ny)))) + if (pos.normalise () && !(OB_TYPE_MOVE_BLOCK (env, pos->move_block))) { hit_map (aura, i, aura->attacktype, 0); if (aura->other_arch) - m->insert (arch_to_object (aura->other_arch), nx, ny, aura); + pos.insert (arch_to_object (aura->other_arch), aura); } } /* put the aura back in the player's inventory */ - aura->remove (); - insert_ob_in_ob (aura, env); + env->insert (aura); + aura->set_owner (owner); } /* moves the peacemaker spell.