tfe-1.0/area/
tfe-1.0/files/
tfe-1.0/logs/
tfe-1.0/logs/immortal/
tfe-1.0/logs/mob/
tfe-1.0/logs/object/
tfe-1.0/logs/player/
tfe-1.0/logs/room/
tfe-1.0/notes/clans/
tfe-1.0/player/
tfe-1.0/prev/
tfe-1.0/prev/area/
tfe-1.0/prev/player/
tfe-1.0/prev/rooms/
tfe-1.0/rooms/
tfe-1.0/src-gc/
tfe-1.0/src-msvc/
tfe-1.0/src-unix/
tfe-1.0/www/
tfe-1.0/www/html/
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include "define.h"
#include "struct.h"


/*
 *   CONSOLIDATE ROUTINES
 */


void consolidate( thing_array& array )
{
  obj_data* obj;

  for( int i = array-1; i >= 0; i-- ) 
    if( ( obj = object( array[i] ) ) != NULL )
      consolidate( obj );
}


void consolidate( obj_data* obj1 ) 
{
  obj_data*  obj2;

  for( int i = 0; i < *obj1->array; i++ ) 
    if( ( obj2 = object( obj1->array->list[i] ) ) != NULL
      && obj1 != obj2 && is_same( obj1, obj2 ) ) {
      obj2->number += obj1->number;
      *obj1->array -= obj1;
      obj1->array   = NULL;
      obj1->Extract( );
      break;
      }
}