Esempio n. 1
0
void display_entity_system_statistics (void)
{
	entity_types
		type;

	debug_colour_log (DEBUG_COLOUR_AMBER, "=====================================");
	debug_colour_log (DEBUG_COLOUR_AMBER, "ENTITY SYSTEM STATISTICS");
	debug_colour_log (DEBUG_COLOUR_AMBER, "-------------------------------------");

	debug_colour_log
	(
		DEBUG_COLOUR_RED,
		"%-25.25s: entity peak count = %d (%.2f percent usage)",
		"ENTITY PEAK USAGE",
		entity_peak_count,
		((float) entity_peak_count * 100.0) / (float) number_of_entities
	);

	for (type = 0; type < NUM_ENTITY_TYPES; type++)
	{
		debug_colour_log
	  	(
			DEBUG_COLOUR_AMBER,
			"%-25.25s: total created = %5d, count = %5d, peak count = %5d, sizeof = %5d",
			get_entity_type_name (type),
			entity_type_stats[type].total_created,
			entity_type_stats[type].count,
			entity_type_stats[type].peak_count,
			entity_type_database[type].size_of_data
		);
	}

	debug_colour_log (DEBUG_COLOUR_AMBER, "=====================================");
}
Esempio n. 2
0
static void default_unpack_entity_data (entity *en, entity_types type, pack_modes mode)
{
    if (mode == PACK_MODE_UPDATE_ENTITY)
    {
        debug_fatal ("default_unpack_entity_data invoked: %s (index = %d)", get_local_entity_type_name (en), get_local_entity_index (en));
    }
    else
    {
        debug_fatal ("default_unpack_entity_data invoked: %s", get_entity_type_name (type));
    }
}
Esempio n. 3
0
void initialise_entity_type_names (void)
{

	int
		loop;

	entity_type_names = (char **) malloc_heap_mem (sizeof (char *) * NUM_ENTITY_TYPES + 1);

	for (loop = 0; loop < NUM_ENTITY_TYPES; loop ++)
	{

		entity_type_names [loop] = get_entity_type_name (loop);
	}
}
Esempio n. 4
0
static void debug_log_text (entity_debug_modes mode, entity *en, char *format, ...)
{
	va_list
		pargs;

	char
		s1[400],
		s2[400],
		*name;

	//
	// prefix
	//

	strcpy (s1, debug_log_comms_prefix[get_comms_model ()][get_comms_data_flow ()]);

	strcat (s1, debug_log_mode_prefix[mode]);

	//
	// entity type and index
	//

	if (en)
	{
		name = get_local_entity_type_name (en);
	}
	else
	{
		name = get_entity_type_name (ENTITY_TYPE_UNKNOWN);
	}

	sprintf (s2, "%-25.25s (index = %5d): ", name, get_local_entity_safe_index (en));

	strcat (s1, s2);

	//
	// args
	//

	va_start (pargs, format);

	vsprintf (s2, format, pargs);

	va_end (pargs);

	strcat (s1, s2);

	debug_log (s1);
}
Esempio n. 5
0
void debug_log_entity_args (entity_debug_modes mode, entity_debug_args arg, entity *en, ...)
{
	va_list
		pargs;

	////////////////////////////////////////
	//
	// trap remote args in single player game
	//
	////////////////////////////////////////

	if (!debug_log_entity_args_enabled)
	{
		return;
	}

	if (mode == ENTITY_DEBUG_REMOTE)
	{
		if (direct_play_get_comms_mode () == DIRECT_PLAY_COMMS_MODE_NONE)
		{
			return;
		}
	}

	////////////////////////////////////////
	//
	// sort debug log text
	//
	////////////////////////////////////////

	va_start (pargs, en);

	switch (arg)
	{
		////////////////////////////////////////
		case ENTITY_DEBUG_ATTITUDE_ANGLES:
		////////////////////////////////////////
		{
			//
			// (entity_debug_modes mode, entity_debug_args arg, entity *en, float heading, float pitch, float roll)
			//

			float
				heading,
				pitch,
				roll;

			heading = va_arg (pargs, double);

			pitch = va_arg (pargs, double);

			roll = va_arg (pargs, double);

			debug_log_text (mode, en, "attitude angles (h = %.3f, p = %.3f, r = %.3f)", deg (heading), deg (pitch), deg (roll));

			break;
		}
		////////////////////////////////////////
		case ENTITY_DEBUG_ATTITUDE_MATRIX:
		////////////////////////////////////////
		{
			//
			// (entity_debug_modes mode, entity_debug_args arg, entity *en, matrix3x3 attitude)
			//

			matrix3x3
				*attitude;

			float
				heading,
				pitch,
				roll;

			attitude = va_arg (pargs, matrix3x3 *);

			ASSERT (attitude);

			heading = get_heading_from_attitude_matrix (*attitude);

			pitch = get_pitch_from_attitude_matrix (*attitude);

			roll = get_roll_from_attitude_matrix (*attitude);

			debug_log_text (mode, en, "attitude matrix (h = %.3f, p = %.3f, r = %.3f)", deg (heading), deg (pitch), deg (roll));

			break;
		}
		////////////////////////////////////////
		case ENTITY_DEBUG_CHAR_TYPE:
		////////////////////////////////////////
		{
			//
			// (entity_debug_modes mode, entity_debug_args arg, entity *en, char_types type)
			//

			char_types
				type;

			type = va_arg (pargs, char_types);

			debug_log_text (mode, NULL, "char type = %s", get_char_type_name (type));

			break;
		}
		////////////////////////////////////////
		case ENTITY_DEBUG_CHAR_VALUE:
		////////////////////////////////////////
		{
			//
			// (entity_debug_modes mode, entity_debug_args arg, entity *en, char_types type, char value)
			//

			char_types
				type;

			char
				value;

			type = va_arg (pargs, char_types);

			value = va_arg (pargs, int);

			debug_log_text (mode, en, "%s = %c", get_char_type_name (type), value);

			break;
		}
		////////////////////////////////////////
		case ENTITY_DEBUG_CREATE:
		////////////////////////////////////////
		{
			//
			// (entity_debug_modes mode, entity_debug_args arg, entity *en, entity_types type, int index)
			//

			entity_types
				type;

			int
				index;

			type = va_arg (pargs, entity_types);

			index = va_arg (pargs, int);

			debug_log_text (mode, NULL, "create %s (index = %d): ", get_entity_type_name (type), index);

			break;
		}
		////////////////////////////////////////
		case ENTITY_DEBUG_DESTROY:
		////////////////////////////////////////
		{
			//
			// (entity_debug_modes mode, entity_debug_args arg, entity *en)
			//

			debug_log_text (mode, en, "destroy");

			break;
		}
		////////////////////////////////////////
		case ENTITY_DEBUG_DESTROY_FAMILY:
		////////////////////////////////////////
		{
			//
			// (entity_debug_modes mode, entity_debug_args arg, entity *en)
			//

			debug_log_text (mode, en, "destroy family");

			break;
		}
		////////////////////////////////////////
		case ENTITY_DEBUG_ENTITY_ATTRIBUTE:
		////////////////////////////////////////
		{
			//
			// (entity_debug_modes mode, entity_debug_args arg, entity *en, entity_attributes attr)
			//

			entity_attributes
				attr;

			attr = va_arg (pargs, entity_attributes);

			debug_log_text (mode, NULL, "entity attribute = %s", get_entity_attribute_name (attr));

			break;
		}
		////////////////////////////////////////
		case ENTITY_DEBUG_ENTITY_COMMS_MESSAGE:
		////////////////////////////////////////
		{
			//
			// (entity_debug_modes mode, entity_debug_args arg, entity *en, entity_comms_messages message)
			//

			entity_comms_messages
				message;

			message = va_arg (pargs, entity_comms_messages);

			debug_log_text (mode, NULL, "entity comms message = %s", get_entity_comms_message_name (message));

			break;
		}
		////////////////////////////////////////
		case ENTITY_DEBUG_ENTITY_INDEX:
		////////////////////////////////////////
		{
			//
			// (entity_debug_modes mode, entity_debug_args arg, entity *en, int index)
			//

			int
				index;

			index = va_arg (pargs, int);

			debug_log_text (mode, en, "entity index = %d", index);

			break;
		}
		////////////////////////////////////////
		case ENTITY_DEBUG_ENTITY_TYPE:
		////////////////////////////////////////
		{
			//
			// (entity_debug_modes mode, entity_debug_args arg, entity *en, entity_types type)
			//

			entity_types
				type;

			type = va_arg (pargs, entity_types);

			debug_log_text (mode, en, "entity type = %s", get_entity_type_name (type));

			break;
		}
		////////////////////////////////////////
		case ENTITY_DEBUG_FLOAT_TYPE:
		////////////////////////////////////////
		{
			//
			// (entity_debug_modes mode, entity_debug_args arg, entity *en, float_types type)
			//

			float_types
				type;

			type = va_arg (pargs, float_types);

			debug_log_text (mode, NULL, "float type = %s", get_float_type_name (type));

			break;
		}
		////////////////////////////////////////
		case ENTITY_DEBUG_FLOAT_VALUE:
		////////////////////////////////////////
		{
			//
			// (entity_debug_modes mode, entity_debug_args arg, entity *en, float_types type, float value)
			//

			float_types
				type;

			float
				value;

			type = va_arg (pargs, float_types);

			value = va_arg (pargs, double);

			debug_log_text (mode, en, "%s = %.3f", get_float_type_name (type), value);

			break;
		}
		////////////////////////////////////////
		case ENTITY_DEBUG_INT_TYPE:
		////////////////////////////////////////
		{
			//
			// (entity_debug_modes mode, entity_debug_args arg, entity *en, int_types type)
			//

			int_types
				type;

			type = va_arg (pargs, int_types);

			debug_log_text (mode, NULL, "int type = %s", get_int_type_name (type));

			break;
		}
		////////////////////////////////////////
		case ENTITY_DEBUG_INT_VALUE:
		////////////////////////////////////////
		{
			//
			// (entity_debug_modes mode, entity_debug_args arg, entity *en, int_types type, int value)
			//

			int_types
				type;

			int
				value;

			type = va_arg (pargs, int_types);

			value = va_arg (pargs, int);

			debug_log_text (mode, en, "%s = %d", get_int_type_name (type), value);

			break;
		}
		////////////////////////////////////////
		case ENTITY_DEBUG_KILL:
		////////////////////////////////////////
		{
			//
			// (entity_debug_modes mode, entity_debug_args arg, entity *en)
			//

			debug_log_text (mode, en, "kill");

			break;
		}
		////////////////////////////////////////
		case ENTITY_DEBUG_LIST_TYPE:
		////////////////////////////////////////
		{
			//
			// (entity_debug_modes mode, entity_debug_args arg, entity *en, list_types type)
			//

			list_types
				type;

			type = va_arg (pargs, list_types);

			debug_log_text (mode, NULL, "list type = %s", get_list_type_name (type));

			break;
		}
		////////////////////////////////////////
		case ENTITY_DEBUG_LIST_TYPE_CHILD_PRED:
		////////////////////////////////////////
		{
			//
			// (entity_debug_modes mode, entity_debug_args arg, entity *en, list_types type, entity *child_pred)
			//

			list_types
				type;

			entity
				*child_pred;

			int
				index;

			type = va_arg (pargs, list_types);

			child_pred = va_arg (pargs, entity *);

			index = get_local_entity_safe_index (child_pred);

			debug_log_text (mode, en, "%s child pred index = %d", get_list_type_name (type), index);

			break;
		}
		////////////////////////////////////////
		case ENTITY_DEBUG_LIST_TYPE_CHILD_SUCC:
		////////////////////////////////////////
		{
			//
			// (entity_debug_modes mode, entity_debug_args arg, entity *en, list_types type, entity *child_succ)
			//

			list_types
				type;

			entity
				*child_succ;

			int
				index;

			type = va_arg (pargs, list_types);

			child_succ = va_arg (pargs, entity *);

			index = get_local_entity_safe_index (child_succ);

			debug_log_text (mode, en, "%s child succ index = %d", get_list_type_name (type), index);

			break;
		}
		////////////////////////////////////////
		case ENTITY_DEBUG_LIST_TYPE_FIRST_CHILD:
		////////////////////////////////////////
		{
			//
			// (entity_debug_modes mode, entity_debug_args arg, entity *en, list_types type, entity *first_child)
			//

			list_types
				type;

			entity
				*first_child;

			int
				index;

			type = va_arg (pargs, list_types);

			first_child = va_arg (pargs, entity *);

			index = get_local_entity_safe_index (first_child);

			debug_log_text (mode, en, "%s first child index = %d", get_list_type_name (type), index);

			break;
		}
		////////////////////////////////////////
		case ENTITY_DEBUG_LIST_TYPE_PARENT:
		////////////////////////////////////////
		{
			//
			// (entity_debug_modes mode, entity_debug_args arg, entity *en, list_types type, entity *parent)
			//

			list_types
				type;

			entity
				*parent;

			int
				index;

			type = va_arg (pargs, list_types);

			parent = va_arg (pargs, entity *);

			index = get_local_entity_safe_index (parent);

			debug_log_text (mode, en, "%s parent index = %d", get_list_type_name (type), index);

			break;
		}
		////////////////////////////////////////
		case ENTITY_DEBUG_PTR_TYPE:
		////////////////////////////////////////
		{
			//
			// (entity_debug_modes mode, entity_debug_args arg, entity *en, ptr_types type)
			//

			ptr_types
				type;

			type = va_arg (pargs, ptr_types);

			debug_log_text (mode, NULL, "ptr type = %s", get_ptr_type_name (type));

			break;
		}
		////////////////////////////////////////
		case ENTITY_DEBUG_PTR_VALUE:
		////////////////////////////////////////
		{
			//
			// (entity_debug_modes mode, entity_debug_args arg, entity *en, ptr_types type, void *ptr)
			//

			ptr_types
				type;

			void
				*ptr;

			type = va_arg (pargs, ptr_types);

			ptr = va_arg (pargs, void *);

			debug_log_text (mode, en, "%s = 0x%x", get_ptr_type_name (type), ptr);

			break;
		}
		////////////////////////////////////////
		case ENTITY_DEBUG_STRING_TYPE:
		////////////////////////////////////////
		{
			//
			// (entity_debug_modes mode, entity_debug_args arg, entity *en, string_types type)
			//

			string_types
				type;

			type = va_arg (pargs, string_types);

			debug_log_text (mode, NULL, "string type = %s", get_string_type_name (type));

			break;
		}
		////////////////////////////////////////
		case ENTITY_DEBUG_STRING:
		////////////////////////////////////////
		{
			//
			// (entity_debug_modes mode, entity_debug_args arg, entity *en, string_types type, char *s)
			//

			string_types
				type;

			char
				*s;

			type = va_arg (pargs, string_types);

			s = va_arg (pargs, char *);

			ASSERT (s);

			debug_log_text (mode, en, "%s = %s", get_string_type_name (type), s);

			break;
		}
		////////////////////////////////////////
		case ENTITY_DEBUG_VEC3D_TYPE:
		////////////////////////////////////////
		{
			//
			// (entity_debug_modes mode, entity_debug_args arg, entity *en, vec3d_types type)
			//

			vec3d_types
				type;

			type = va_arg (pargs, vec3d_types);

			debug_log_text (mode, NULL, "vec3d type = %s", get_vec3d_type_name (type));

			break;
		}
		////////////////////////////////////////
		case ENTITY_DEBUG_VEC3D:
		////////////////////////////////////////
		{
			//
			// (entity_debug_modes mode, entity_debug_args arg, entity *en, vec3d_types type, vec3d *v)
			//

			vec3d_types
				type;

			vec3d
				*v;

			type = va_arg (pargs, vec3d_types);

			v = va_arg (pargs, vec3d *);

			ASSERT (v);

			if (type == VEC3D_TYPE_POSITION)
			{
				int
					x_sec,
					z_sec;

				get_x_sector (x_sec, v->x);
				get_z_sector (z_sec, v->z);

				debug_log_text (mode, en, "%s = (x = %.3f, y = %.3f, z = %.3f, x sec = %d, z sec = %d)", get_vec3d_type_name (type), v->x, v->y, v->z, x_sec, z_sec);
			}
			else
			{
				debug_log_text (mode, en, "%s = (x = %.3f, y = %.3f, z = %.3f)", get_vec3d_type_name (type), v->x, v->y, v->z);
			}

			break;
		}
		////////////////////////////////////////
		default:
		////////////////////////////////////////
		{
			debug_fatal ("Invalid entity debug arg = %d", arg);

			break;
		}
	}

	va_end (pargs);
}
Esempio n. 6
0
entity *regen_update (entity *en)
{

	regen_management_element
		*m1;

	entity_sub_types
		member_type,
		group_type;

	entity
		*wp,
		*task,
		*group,
		*member,
		*building,
		*force_en,
		*landing,
		*keysite;

	unsigned int
		member_number;

	int
		reserve_count;

	force
		*force_raw;

	regen
		*raw;

	regen_list_element
		*e1;

	raw = (regen *) get_local_entity_data (en);

	wp = get_local_entity_parent (en, LIST_TYPE_CURRENT_WAYPOINT);

	task = get_local_entity_parent (wp, LIST_TYPE_WAYPOINT);

	landing = get_local_entity_parent (task, LIST_TYPE_UNASSIGNED_TASK);
			
	keysite = get_local_entity_parent (landing, LIST_TYPE_LANDING_SITE);

	force_en = get_local_force_entity ((entity_sides) raw->side);

	force_raw = (force *) get_local_entity_data (force_en);

	group_type = NUM_ENTITY_SUB_TYPE_GROUPS;

	m1 = &regen_manager [raw->side][raw->sub_type];

	//
	// is there anything in the regen queues?
	//
	
	if (m1->count == 0)
	{
		return NULL;
	}

	//
	// Can regen operate
	//

	building = raw->member_root.first_child;

	if ((!get_local_entity_int_value (building, INT_TYPE_ALIVE)) || (get_local_entity_int_value (keysite, INT_TYPE_KEYSITE_USABLE_STATE) != KEYSITE_STATE_USABLE))
	{
		#if DEBUG_MODULE

		debug_log ("RG_UPDT: keysite %s too damaged to regen", get_local_entity_string (keysite, STRING_TYPE_KEYSITE_NAME));

		#endif

		return NULL;
	}

	e1 = &regen_queue [raw->side][raw->sub_type][m1->front];

	ASSERT (e1->type != -1);
	ASSERT (e1->sub_type != -1);
	ASSERT (e1->group != -1);

	// is there a reserve of this type?
	if ((e1->type == ENTITY_TYPE_FIXED_WING) || (e1->type == ENTITY_TYPE_HELICOPTER))
	{
		reserve_count = force_raw->force_info_reserve_hardware[aircraft_database[e1->sub_type].force_info_catagory];
	}
	else
	{
		reserve_count = force_raw->force_info_reserve_hardware[vehicle_database[e1->sub_type].force_info_catagory];
	}

	if (reserve_count <= 0)
	{
		return NULL;
	}

	#if DEBUG_MODULE

	debug_log ("RG_UPDT: Trying to Regen %s Sub Type %d at %s - reserve count %d",
								get_entity_type_name (e1->type), e1->sub_type,
								get_local_entity_string (keysite, STRING_TYPE_KEYSITE_NAME), reserve_count);

	#endif

	//
	// Don't regen if PLAYER landed there
	//

	group = get_local_entity_first_child (keysite, LIST_TYPE_KEYSITE_GROUP);

	while (group)
	{
		member = get_local_entity_first_child (group, LIST_TYPE_MEMBER);

		while (member)
		{

			if (get_local_entity_int_value (member, INT_TYPE_PLAYER) != ENTITY_PLAYER_AI)
			{

				if (get_local_entity_int_value (member, INT_TYPE_LANDED))
				{
					#if DEBUG_MODULE

					debug_log ("RG_UPDT: PLAYER landed at keysite %s, can't regen", get_local_entity_string (keysite, STRING_TYPE_KEYSITE_NAME));

					#endif

					return NULL;
				}
			}

			member = get_local_entity_child_succ (member, LIST_TYPE_MEMBER);
		}

		group = get_local_entity_child_succ (group, LIST_TYPE_KEYSITE_GROUP);
	}

	group_type = e1->group;
	
	member_type = e1->sub_type;

	////////////////////////////////////////////////////////////////////////////
	// Dont regen people or transport aircraft in apache havoc campaign as airport might not be correct (landing routes etc)
	////////////////////////////////////////////////////////////////////////////
	if (get_local_entity_int_value (get_session_entity (), INT_TYPE_CAMPAIGN_REQUIRES_APACHE_HAVOC))
	{

		switch (get_local_entity_int_value (en, INT_TYPE_ENTITY_SUB_TYPE))
		{

			case ENTITY_SUB_TYPE_REGEN_PEOPLE:
			{

				#if DEBUG_MODULE

				debug_log ("RG_UPDT: Stopping Regening People - wrong warzone");

				#endif

				return NULL;
			}

			case ENTITY_SUB_TYPE_REGEN_FIXED_WING:
			{

				if (group_database [group_type].default_landing_type == ENTITY_SUB_TYPE_LANDING_FIXED_WING_TRANSPORT)
				{

					#if DEBUG_MODULE

					debug_log ("RG_UPDT: Stopping Regening Transport aircraft - wrong warzone");

					#endif

					return NULL;
				}
			}
		}
	}
	////////////////////////////////////////////////////////////////////////////
	// Dont regen people or transport aircraft in apache havoc campaign as airport might not be correct (landing routes etc)
	////////////////////////////////////////////////////////////////////////////

	if (group_type != NUM_ENTITY_SUB_TYPE_GROUPS)
	{

		int
			route_node;

		entity
			*building,
			*member,
			*guide,
			*group = NULL;

		group = create_landing_faction_members (keysite, member_type, group_type, 1, wp, &raw->position);

		if (group)
		{

			//
			// Assign closest route_node (only needed for routed vehicles)
			//

			if (get_local_entity_int_value (group, INT_TYPE_FRONTLINE))
			{
	
				route_node = get_closest_side_road_node ((entity_sides) get_local_entity_int_value (group, INT_TYPE_SIDE), &raw->position, 5 * KILOMETRE);
	
				set_client_server_entity_int_value (group, INT_TYPE_ROUTE_NODE, route_node);
			}

			//
			//
			//
			
			member = get_local_entity_first_child (group, LIST_TYPE_MEMBER);

			//
			// close members doors
			//

			close_client_server_entity_cargo_doors (member);

			close_client_server_entity_loading_doors (member);

			//
			// open building doors
			//

			building = get_local_entity_first_child (en, LIST_TYPE_MEMBER);

			open_client_server_entity_loading_doors (building);

			set_local_entity_float_value (building, FLOAT_TYPE_LOADING_DOOR_TIMER, 30.0);

			//
			// create guide entity for task (TEST)
			//

			// Debug for Transport aircraft.
			// Locate nearest Transport landing wp and insert into it
			if (group_database [group_type].default_landing_type == ENTITY_SUB_TYPE_LANDING_FIXED_WING_TRANSPORT)
			{

				float
					range,
					best_range;

				entity
					*transport_wp,
					*transport_task,
					*transport_landing;

				best_range = 999999999.0;

				transport_landing = get_local_entity_landing_entity (keysite, ENTITY_SUB_TYPE_LANDING_FIXED_WING_TRANSPORT);

				if (transport_landing)
				{
	
					transport_task = get_local_landing_entity_task (transport_landing, ENTITY_SUB_TYPE_TASK_LANDING);

					ASSERT (transport_task);
	
					transport_wp = get_local_entity_first_child (transport_task, LIST_TYPE_WAYPOINT);

					ASSERT (transport_wp);
	
					while (transport_wp)
					{
	
						range = get_sqr_2d_range (get_local_entity_vec3d_ptr (transport_wp, VEC3D_TYPE_POSITION), get_local_entity_vec3d_ptr (building, VEC3D_TYPE_POSITION));
	
						if (range < best_range)
						{
	
							wp = transport_wp;
	
							task = transport_task;
	
							best_range = range;
						}
	
						transport_wp = get_local_entity_child_succ (transport_wp, LIST_TYPE_WAYPOINT);
					}
				}
			}
			// Debug for Transport aircraft.

			member_number = get_local_entity_int_value (member, INT_TYPE_GROUP_MEMBER_NUMBER);

			guide = create_client_server_guide_entity (task, wp, (1 << member_number));

			attach_group_to_guide_entity (group, guide);

			attach_group_member_to_guide_entity (member, guide);

			//#if DEBUG_MODULE
			{

				entity
					*keysite;

				keysite = get_local_entity_parent (landing, LIST_TYPE_LANDING_SITE);

				member = get_local_entity_first_child (group, LIST_TYPE_MEMBER);

				debug_log ("RG_UPDT: %s creating %s (%d) at keysite %s free landing sites %d, reserved %d, lock %d, available lock: %d",
						entity_side_names [get_local_entity_int_value (keysite, INT_TYPE_SIDE)],
						get_local_entity_type_name (member),
						get_local_entity_index (member),
						get_local_entity_string (keysite, STRING_TYPE_KEYSITE_NAME), 
						get_local_entity_int_value (landing, INT_TYPE_FREE_LANDING_SITES),
						get_local_entity_int_value (landing, INT_TYPE_RESERVED_LANDING_SITES),
						get_local_entity_int_value (landing, INT_TYPE_LANDING_LOCK),
						check_available_landing_route_lock (landing)
						);

				if ((e1->type == ENTITY_TYPE_FIXED_WING) || (e1->type == ENTITY_TYPE_HELICOPTER))
				{
					debug_log("%s reserves left: %d",
							force_info_catagory_names[aircraft_database[e1->sub_type].force_info_catagory],
							force_raw->force_info_reserve_hardware[aircraft_database[e1->sub_type].force_info_catagory]
							);
				}
				else
				{
					debug_log("%s reserves left: %d",
							force_info_catagory_names[vehicle_database[e1->sub_type].force_info_catagory],
							force_raw->force_info_reserve_hardware[vehicle_database[e1->sub_type].force_info_catagory]
							);
				}

			}
			//#endif

			#if DEBUG_MODULE
			switch (e1->type)
			{
				case ENTITY_TYPE_FIXED_WING:
				case ENTITY_TYPE_HELICOPTER:
				{
					ASSERT (regen_ac_debug[e1->sub_type] > 0);

					break;
				}
				
				case ENTITY_TYPE_ROUTED_VEHICLE:
				case ENTITY_TYPE_SHIP_VEHICLE:
				case ENTITY_TYPE_PERSON:
				{
					ASSERT (regen_vh_debug[e1->sub_type] > 0);

					break;
				}
				
				default:
				{
					debug_fatal ("RG_UPDT: Unknown entity type for debug");
				}
				
			}
			#endif

			// update markers
			regen_queue_use ((entity_sides) raw->side, (raw->sub_type));

			return member;
		}
	}
	else
	{
		#if DEBUG_MODULE >= 2

		debug_log ("RG_UPDT: not creating anything at keysite %s free landing sites %d, reserved %d, lock %d",
						get_local_entity_string (keysite, STRING_TYPE_KEYSITE_NAME), 
						get_local_entity_int_value (landing, INT_TYPE_FREE_LANDING_SITES),
						get_local_entity_int_value (landing, INT_TYPE_RESERVED_LANDING_SITES),
						check_available_landing_route_lock (landing));

		#endif
	}

	return NULL;
}