Beispiel #1
0
void kill_local_entity_sound_type (entity *en, entity_sub_types type)
{
	entity
		*spec,
		*next;

	sound_effect
		*raw;

	spec = get_local_entity_first_child (en, LIST_TYPE_SPECIAL_EFFECT);
	
	while (spec)
	{
		next = get_local_entity_child_succ (spec, LIST_TYPE_SPECIAL_EFFECT);

		if (get_local_entity_type (spec) == ENTITY_TYPE_SOUND_EFFECT)
		{
			raw = get_local_entity_data (spec);

			if (raw->eff.sub_type == type)
			{
				//
				// "kill" sound
				//

				kill_local_entity (spec);
			}
		}

		spec = next;
	}
}
Beispiel #2
0
static void kill_server (entity *en)
{
	//
	// kill remote entity first (keeping local entity valid)
	//

	validate_client_server_remote_fn ();

	kill_remote (en);

	validate_client_server_local_fn ();

	//
	// kill local using 'full' function
	//

	kill_local_entity (en);
}
Beispiel #3
0
static void kill_client (entity *en)
{
	if (get_comms_data_flow () == COMMS_DATA_FLOW_TX)
	{
		validate_client_server_remote_fn ();

		kill_remote (en);
	}
	else
	{
		validate_client_server_local_fn ();

		//
		// kill local using 'full' function
		//

		kill_local_entity (en);
	}
}
Beispiel #4
0
void kill_local_restored_anti_aircraft_entity (entity *en)
{

	anti_aircraft
		*raw;

	entity
		*group;

	raw = (anti_aircraft *) get_local_entity_data (en);

	// must be done before alive flag set to FALSE
	remove_mobile_values_from_sector (get_local_entity_parent (en, LIST_TYPE_SECTOR), en);

	set_local_entity_int_value (en, INT_TYPE_ALIVE, FALSE);

	damage_anti_aircraft_3d_object (en);

	set_local_entity_int_value (en, INT_TYPE_OPERATIONAL_STATE, OPERATIONAL_STATE_DEAD);

	////////////////////////////////////////
	//
	// DESTROY COMPONENTS
	//
	////////////////////////////////////////

	group = get_local_entity_parent (en, LIST_TYPE_MEMBER);

	////////////////////////////////////////
	//
	// UNLINK FROM SYSTEM
	//
	////////////////////////////////////////

	unlink_local_entity_children (en, LIST_TYPE_TASK_DEPENDENT);

	unlink_local_entity_children (en, LIST_TYPE_LAUNCHED_WEAPON);

	delete_local_entity_from_parents_child_list (en, LIST_TYPE_MEMBER);

	delete_local_entity_from_parents_child_list (en, LIST_TYPE_FOLLOWER);

	// gunship_target_link

	// member_link

	// view_link

	unlink_local_entity_children (en, LIST_TYPE_TARGET);

	delete_local_entity_from_parents_child_list (en, LIST_TYPE_PADLOCK);

	// sector_link

	delete_local_entity_from_parents_child_list (en, LIST_TYPE_TARGET);

	delete_local_entity_from_parents_child_list (en, LIST_TYPE_UPDATE);

	//
	// kill weapon sound effects
	//

	kill_local_entity_sound_type (en, ENTITY_SUB_TYPE_EFFECT_SOUND_CHAIN_GUN);

	//
	// Notify the GROUP that the mobile has been killed  (N.B. must be done AFTER mobile is unlinked from member list)
	//

	if (get_comms_model () == COMMS_MODEL_SERVER)
	{
		notify_local_entity (ENTITY_MESSAGE_MOBILE_KILLED, group, en);
	}
	else
	{
		//
		// Client - Kill local group if empty
		//

		if (get_local_entity_int_value (group, INT_TYPE_MEMBER_COUNT) == 0)
		{
			kill_local_entity (group);
		}
	}
}