--- deliantra/server/common/map.C 2007/04/17 10:06:32 1.100 +++ deliantra/server/common/map.C 2007/04/21 16:56:28 1.101 @@ -355,38 +355,14 @@ return; for (mapspace *ms = spaces + size (); ms-- > spaces; ) - for (object *tmp = ms->bot; tmp; tmp = tmp->above) + for (object *op = ms->bot; op; op = op->above) { /* already multipart - don't do anything more */ - if (!tmp->head && !tmp->more) + if (!op->head && !op->more && op->arch->more) { - /* If there is nothing more to this object, this for loop - * won't do anything. - */ - archetype *at; - object *last, *op; - for (at = tmp->arch->more, last = tmp; - at; - at = at->more, last = op) - { - op = arch_to_object (at); - - /* update x,y coordinates */ - op->x += tmp->x; - op->y += tmp->y; - op->head = tmp; - op->map = this; - last->more = op; - op->name = tmp->name; - op->title = tmp->title; - - /* we could link all the parts onto tmp, and then just - * call insert_ob_in_map once, but the effect is the same, - * as insert_ob_in_map will call itself with each part, and - * the coding is simpler to just to it here with each part. - */ - insert_ob_in_map (op, op->map, tmp, INS_NO_MERGE | INS_ABOVE_FLOOR_ONLY | INS_NO_WALK_ON); - } + op->remove (); + op->expand_tail (); + insert (op, op->x, op->y, 0, INS_NO_MERGE | INS_ABOVE_FLOOR_ONLY | INS_NO_WALK_ON); } } } @@ -433,23 +409,23 @@ void maptile::activate () { - if (!spaces) - return; + active = true; - for (mapspace *ms = spaces + size (); ms-- > spaces; ) - for (object *op = ms->bot; op; op = op->above) - op->activate_recursive (); + if (spaces) + for (mapspace *ms = spaces + size (); ms-- > spaces; ) + for (object *op = ms->bot; op; op = op->above) + op->activate_recursive (); } void maptile::deactivate () { - if (!spaces) - return; + active = false; - for (mapspace *ms = spaces + size (); ms-- > spaces; ) - for (object *op = ms->bot; op; op = op->above) - op->deactivate_recursive (); + if (spaces) + for (mapspace *ms = spaces + size (); ms-- > spaces; ) + for (object *op = ms->bot; op; op = op->above) + op->deactivate_recursive (); } bool