Exemple #1
0
void clinic_free(clinic_t * self){
    int i;
    for(i = 0; i < NUM_ROOM; i++)
        room_free(self->room[i]);
    list_free(self->subscribers);
    free(self);
}
Exemple #2
0
static void room_new__seats__self(void ** state){

int number =  2;
int mas[2] = {1,2};
room_t * self = NULL;
self  = room_new(number);
assert_non_null(self);
 room_free(self);

}
Exemple #3
0
void
scene_free (scene_t *scene)
{
  scene_t *scene_p;

  while (scene)
  {
    room_free (scene->rooms);
    if (scene->id)
      free (scene->id);
    scene_p = scene;
    scene = scene->next;
    free (scene_p);
  }
}
Exemple #4
0
/*
 * This procdure frees up the strings and/or the structures
 * attatched to a descriptor, sets all flags back to how they
 * should be.
 */
void cleanup_olc(DESCRIPTOR_DATA * d, byte cleanup_type)
{
	if (d->olc)
	{

		// Освободить редактируемый триггер
		if (OLC_TRIG(d))
		{
			if (OLC_TRIG(d)->name)
				free(OLC_TRIG(d)->name);
			if (OLC_TRIG(d)->arglist)
				free(OLC_TRIG(d)->arglist);
			free(OLC_TRIG(d));
		}
		// Освободить массив данных (похоже, только для триггеров)
		if (OLC_STORAGE(d))
		{
			free(OLC_STORAGE(d));
		}
		// Освободить прототип
		if (OLC_SCRIPT(d))
		{
			dg_olc_script_free(d);
		}
		// Освободить комнату
		if (OLC_ROOM(d))
		{
			switch (cleanup_type)
			{
			case CLEANUP_ALL:
				room_free(OLC_ROOM(d));	// удаляет все содержимое
				// break; - не нужен
			case CLEANUP_STRUCTS:
				delete OLC_ROOM(d);	// удаляет только оболочку
				break;
			default:	// The caller has screwed up.
				break;
			}
		}
		// Освободить mob
		if (OLC_MOB(d))
		{
			switch (cleanup_type)
			{
			case CLEANUP_ALL:
				medit_mobile_free(OLC_MOB(d));	// удаляет все содержимое
				delete OLC_MOB(d);	// удаляет только оболочку
				break;
			default:	// The caller has screwed up.
				break;
			}
		}
		// Освободить объект
		if (OLC_OBJ(d))
		{
			switch (cleanup_type)
			{
			case CLEANUP_ALL:
				oedit_object_free(OLC_OBJ(d));	// удаляет все содержимое
				delete OLC_OBJ(d);	// удаляет только оболочку
				break;
			default:	// The caller has screwed up.
				break;
			}
		}

		// Освободить зону
		if (OLC_ZONE(d))
		{
			free(OLC_ZONE(d)->name);
			zedit_delete_cmdlist((pzcmd) OLC_ZONE(d)->cmd);
			free(OLC_ZONE(d));
		}

		// Restore descriptor playing status.
		if (d->character)
		{
			REMOVE_BIT(PLR_FLAGS(d->character, PLR_WRITING), PLR_WRITING);
			STATE(d) = CON_PLAYING;
			act("$n закончил$g работу и удовлетворенно посмотрел$g в развороченные недра Мироздания.",
				TRUE, d->character, 0, 0, TO_ROOM);
		}
		delete d->olc;
	}
}