Esempio n. 1
0
void remove_mine(int which_mine)
{
	if (which_mine == -1 || which_mine >= NUM_MINES) return;

	if (mine_list[which_mine].obj_3d_id == -1) {
		// Oops, no mine in that slot!
		LOG_ERROR("Oops, double-removal of mine!\n");
		return;
	}

	destroy_3d_object(mine_list[which_mine].obj_3d_id);
	mine_list[which_mine].obj_3d_id = -1;
}
Esempio n. 2
0
void remove_3d_object_from_server (int id)
{	
	if (id < 0 || id > MAX_OBJ_3D)
	{
		LOG_ERROR ("Trying to remove object with invalid id %d", id);
		return;
	}
	if (objects_list[id] == NULL)
	{
		LOG_ERROR ("Trying to remove non-existant object");
		return;
	}

	destroy_3d_object (id);
}
Esempio n. 3
0
void remove_bag(int bag_id)
{
#ifdef NEW_SOUND
	int snd;
#endif // NEW_SOUND

	if (bag_id >= NUM_BAGS) return;

	if (bag_list[bag_id].obj_3d_id == -1) {
		// oops, no bag in that slot!
		LOG_ERROR("Oops, double-removal of bag!\n");
		return;
	}

	if (use_eye_candy) {
		ec_create_bag_pickup(objects_list[bag_list[bag_id].obj_3d_id]->x_pos, objects_list[bag_list[bag_id].obj_3d_id]->y_pos, objects_list[bag_list[bag_id].obj_3d_id]->z_pos, (poor_man ? 6 : 10));
#ifdef ONGOING_BAG_EFFECT
		if (bag_list[bag_id].ongoing_bag_effect_reference != NULL) {
			ec_recall_effect(bag_list[bag_id].ongoing_bag_effect_reference);
			bag_list[bag_id].ongoing_bag_effect_reference = NULL;
		}
#endif // ONGOING_BAG_EFFECT
	}
#ifdef NEW_SOUND
	if (your_actor && bag_list[bag_id].x == your_actor->x_pos * 2 && bag_list[bag_id].y == your_actor->y_pos * 2)
	{
		snd = get_sound_index_for_particle_file_name("./particles/bag_out.part");
		if (snd >= 0)
		{
			add_sound_object (snd, bag_list[bag_id].x, bag_list[bag_id].y, 0);
		}
	}
#endif // NEW_SOUND

	destroy_3d_object(bag_list[bag_id].obj_3d_id);
	bag_list[bag_id].obj_3d_id=-1;
}
Esempio n. 4
0
void clear_sector(Uint16 sector)
{
	int i;
	// 3d objects
	for(i=0;i<MAX_3D_PER_SECTOR;i++){
		if(sectors[sector].e3d_local[i]!=-1){
			destroy_3d_object(sectors[sector].e3d_local[i]);
			sectors[sector].e3d_local[i]=-1;
		}
	}
	//2d objects
	for(i=0;i<MAX_2D_PER_SECTOR;i++){
		if(sectors[sector].e2d_local[i]!=-1){
			free(obj_2d_list[sectors[sector].e2d_local[i]]);
			obj_2d_list[sectors[sector].e2d_local[i]]=0;
			sectors[sector].e2d_local[i]=-1;
		}
	}
	//lights
	for(i=0;i<MAX_LIGHTS_PER_SECTOR;i++){
		if(sectors[sector].lights_local[i]!=-1){
			free(lights_list[sectors[sector].lights_local[i]]);
			lights_list[sectors[sector].lights_local[i]]=0;
			sectors[sector].lights_local[i]=-1;
		}
	}
	//particles
	for(i=0;i<MAX_PARTICLES_PER_SECTOR;i++){
		if(sectors[sector].particles_local[i]!=-1){
			free(particles_list[sectors[sector].particles_local[i]]);
			particles_list[sectors[sector].particles_local[i]]=0;
			sectors[sector].particles_local[i]=-1;
		}
	}

}