--- deliantra/server/server/time.C 2007/07/01 05:00:20 1.59 +++ deliantra/server/server/time.C 2007/07/05 08:10:30 1.60 @@ -147,6 +147,7 @@ void remove_force (object *op) { + fprintf (stderr, "duration %s %d\n", &op->name, op->duration);//D if (--op->duration > 0) return; @@ -1242,49 +1243,21 @@ { if (object *tmp = op->ms ().player ()) { - object *tmp2; - /* remove an old force with a slaying field == op->name */ - for (tmp2 = tmp->inv; tmp2; tmp2 = tmp2->below) - if (tmp2->type == FORCE && tmp2->slaying && tmp2->slaying == op->name) - { - tmp2->destroy (); - break; - } - - /* cycle through his inventory to look for the MARK we want to - * place - */ - for (tmp2 = tmp->inv; tmp2; tmp2 = tmp2->below) - if (tmp2->type == FORCE && tmp2->slaying && tmp2->slaying == op->slaying) - break; + if (object *force = tmp->force_find (op->name)) + force->destroy (); - /* if we didn't find our own MARK */ - if (!tmp2) + if (!tmp->force_find (op->slaying)) { - object *force = get_archetype (FORCE_NAME); - - if (op->stats.food) - { - force->set_speed (0.01); - force->speed_left = -op->stats.food; - } - else - force->set_speed (0); + tmp->force_add (op->slaying, op->stats.food); - /* put in the lock code */ - force->slaying = op->slaying; - - if (op->lore) - force->lore = op->lore; - - insert_ob_in_ob (force, tmp); if (op->msg) new_draw_info (NDI_UNIQUE | NDI_NAVY, 0, tmp, op->msg); if (op->stats.hp > 0) { op->stats.hp--; + if (op->stats.hp == 0) { /* marker expires--granted mark number limit */