void unpack_effect_data (entity *en, effect *raw, pack_modes mode) { ASSERT ((mode >= 0) && (mode < NUM_PACK_MODES)); switch (mode) { //////////////////////////////////////// case PACK_MODE_SERVER_SESSION: case PACK_MODE_CLIENT_SESSION: //////////////////////////////////////// { raw->sub_type = unpack_int_value (en, INT_TYPE_ENTITY_SUB_TYPE); // // some effects should never be packed up ( should be re-constructed when the vehicle is unpacked ) // ASSERT (!effect_database [raw->sub_type].constructed_locally); unpack_vec3d (en, VEC3D_TYPE_POSITION, &raw->position); ///////////////////////////////////////////////////////////////// if (unpack_int_value (en, INT_TYPE_VALID)) { unpack_list_link (en, LIST_TYPE_SPECIAL_EFFECT, &raw->special_effect_link); } ///////////////////////////////////////////////////////////////// // update_link break; } //////////////////////////////////////// case PACK_MODE_BROWSE_SESSION: //////////////////////////////////////// { break; } //////////////////////////////////////// case PACK_MODE_UPDATE_ENTITY: //////////////////////////////////////// { // // cannot update entity at this level as the update may not apply to all entity types below // break; } } }
void unpack_local_keysite_data (pack_modes mode) { entity *en, *landing_en; landing *landing_raw; keysite *raw; int side, landing_lock, landed_lock, takeoff_lock, in_use, index; ASSERT (mode != PACK_MODE_UPDATE_ENTITY); if (mode == PACK_MODE_BROWSE_SESSION) { return; } en = get_local_entity_list (); while (en) { if (get_local_entity_type (en) == ENTITY_TYPE_KEYSITE) { // // unpack keysite // index = unpack_entity_safe_index (); raw = (keysite *) get_local_entity_data (en); raw->supplies.ammo_supply_level = unpack_float_value (en, FLOAT_TYPE_AMMO_SUPPLY_LEVEL); raw->supplies.fuel_supply_level = unpack_float_value (en, FLOAT_TYPE_FUEL_SUPPLY_LEVEL); raw->keysite_strength = unpack_float_value (en, FLOAT_TYPE_KEYSITE_STRENGTH); raw->keysite_maximum_strength = unpack_float_value (en, FLOAT_TYPE_KEYSITE_MAXIMUM_STRENGTH); raw->alive = unpack_int_value (en, INT_TYPE_ALIVE); side = unpack_int_value (en, INT_TYPE_SIDE); if (side != raw->side) { // // update I-Maps (remove old side) // if (raw->in_use) { update_imap_sector_side (en, FALSE); if (mode == PACK_MODE_SERVER_SESSION) { update_imap_importance_level (en, FALSE); } } // // change side of keysite buildings // change_local_keysite_building_sides (en, (entity_sides) side); // // place into other sides force // delete_local_entity_from_parents_child_list (en, LIST_TYPE_KEYSITE_FORCE); insert_local_entity_into_parents_child_list (en, LIST_TYPE_KEYSITE_FORCE, get_local_force_entity ((entity_sides) side), NULL); if (mode == PACK_MODE_SERVER_SESSION) { // Must be done after removed from force update_imap_distance_to_friendly_base ((entity_sides) raw->side); } // // switch sides // raw->side = side; // // update I-Maps (add new side) // if (raw->in_use) { update_imap_sector_side (en, TRUE); if (mode == PACK_MODE_SERVER_SESSION) { update_imap_importance_level (en, TRUE); update_keysite_distance_to_friendly_base (en, (entity_sides) side); } } } in_use = unpack_int_value (en, INT_TYPE_IN_USE); raw->keysite_id = unpack_int_value (en, INT_TYPE_KEYSITE_ID); raw->keysite_usable_state = unpack_int_value (en, INT_TYPE_KEYSITE_USABLE_STATE); if (raw->in_use != in_use) { // // Update I-Maps (in use flag changed) // raw->in_use = in_use; update_imap_sector_side (en, in_use); if (mode == PACK_MODE_SERVER_SESSION) { update_imap_importance_level (en, in_use); if (in_use) { update_keysite_distance_to_friendly_base (en, (entity_sides) side); } else { update_imap_distance_to_friendly_base ((entity_sides) side); } } } unpack_list_root (en, LIST_TYPE_UNASSIGNED_TASK, &raw->unassigned_task_root); unpack_list_root (en, LIST_TYPE_ASSIGNED_TASK, &raw->assigned_task_root); unpack_list_root (en, LIST_TYPE_COMPLETED_TASK, &raw->completed_task_root); // unpack_list_root (en, LIST_TYPE_KEYSITE_GROUP, &raw->keysite_group_root); unpack_list_root (en, LIST_TYPE_DIVISION_HEADQUARTERS, &raw->division_headquarters_root); if (unpack_int_value (en, INT_TYPE_VALID)) { unpack_list_link (en, LIST_TYPE_CAMPAIGN_OBJECTIVE, &raw->campaign_objective_link); } #if DEBUG_MODULE debug_log ("KS_PACK: unpacking keysite %s", raw->keysite_name); #endif if (mode == PACK_MODE_SERVER_SESSION) { raw->repair_timer = unpack_float_value (en, FLOAT_TYPE_REPAIR_TIMER); raw->sleep = unpack_float_value (en, FLOAT_TYPE_SLEEP); raw->assist_timer = unpack_float_value (en, FLOAT_TYPE_ASSIST_TIMER); raw->assign_timer = unpack_float_value (en, FLOAT_TYPE_ASSIGN_TIMER); // // unpack landing data // landing_en = get_local_entity_first_child (en, LIST_TYPE_LANDING_SITE); while (landing_en) { landing_raw = (landing *) get_local_entity_data (landing_en); landing_raw->reserved_landing_sites = unpack_int_value (landing_en, INT_TYPE_RESERVED_LANDING_SITES); //landing_raw->free_landing_sites = unpack_int_value (en, INT_TYPE_FREE_LANDING_SITES); landing_raw->free_landing_sites = landing_raw->total_landing_sites; landing_lock = unpack_int_value (landing_en, INT_TYPE_LANDING_LOCK); landed_lock = unpack_int_value (landing_en, INT_TYPE_LANDED_LOCK); takeoff_lock = unpack_int_value (landing_en, INT_TYPE_TAKEOFF_LOCK); #if DEBUG_MODULE debug_log ("KS_PACK: %s (%d) unpacking %s landing entity, reserved %d, free %d, locks (saved :landing %d, landed %d, takeoff %d, calc landing %d, landed %d, takeoff %d)", raw->keysite_name, get_local_entity_index (en), entity_sub_type_landing_names [landing_raw->sub_type], landing_raw->reserved_landing_sites, landing_raw->free_landing_sites, landing_lock, landed_lock, takeoff_lock, landing_raw->landing_lock, landing_raw->landed_lock, landing_raw->takeoff_lock); if (landing_raw->landing_lock != landing_lock) { debug_log ("KS_PACK: %s %s landing entity needs landing_lock repairing", raw->keysite_name, entity_sub_type_landing_names [landing_raw->sub_type]); } if (landing_raw->landed_lock != landed_lock) { debug_log ("KS_PACK: %s %s landing entity needs landed_lock repairing", raw->keysite_name, entity_sub_type_landing_names [landing_raw->sub_type]); } if (landing_raw->takeoff_lock != takeoff_lock) { debug_log ("KS_PACK: %s %s landing entity needs takeoff_lock repairing", raw->keysite_name, entity_sub_type_landing_names [landing_raw->sub_type]); } #endif unpack_list_root (landing_en, LIST_TYPE_TAKEOFF_QUEUE, &landing_raw->takeoff_queue_root); landing_en = get_local_entity_child_succ (landing_en, LIST_TYPE_LANDING_SITE); } } } en = get_local_entity_succ (en); } }
void unpack_vehicle_data (entity *en, vehicle *raw, pack_modes mode) { int package; ASSERT ((mode >= 0) && (mode < NUM_PACK_MODES)); switch (mode) { //////////////////////////////////////// case PACK_MODE_SERVER_SESSION: case PACK_MODE_CLIENT_SESSION: //////////////////////////////////////// { // // unpack mobile data // unpack_mobile_data (en, &raw->mob, mode); // // unpack vehicle data // raw->object_3d_shape = unpack_int_value (en, INT_TYPE_OBJECT_3D_SHAPE); raw->inst3d = construct_3d_object (raw->object_3d_shape); if (mode == PACK_MODE_SERVER_SESSION) { ///////////////////////////////////////////////////////////////// if (unpack_int_value (en, INT_TYPE_VALID)) { unpack_list_root (en, LIST_TYPE_TASK_DEPENDENT, &raw->task_dependent_root); } ///////////////////////////////////////////////////////////////// } ///////////////////////////////////////////////////////////////// if (unpack_int_value (en, INT_TYPE_VALID)) { unpack_list_root (en, LIST_TYPE_LAUNCHED_WEAPON, &raw->launched_weapon_root); } ///////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////// if (unpack_int_value (en, INT_TYPE_VALID)) { unpack_list_root (en, LIST_TYPE_MOVEMENT_DEPENDENT, &raw->movement_dependent_root); } ///////////////////////////////////////////////////////////////// unpack_list_link (en, LIST_TYPE_FOLLOWER, &raw->follower_link); // gunship_target_link unpack_list_link (en, LIST_TYPE_MEMBER, &raw->member_link); ///////////////////////////////////////////////////////////////// if (unpack_int_value (en, INT_TYPE_VALID)) { unpack_list_link (en, LIST_TYPE_MOVEMENT_DEPENDENT, &raw->movement_dependent_link); } ///////////////////////////////////////////////////////////////// // view_link if (mode == PACK_MODE_SERVER_SESSION) { unpack_list_link (en, LIST_TYPE_TAKEOFF_QUEUE, &raw->takeoff_queue_link); } raw->operational_state = unpack_int_value (en, INT_TYPE_OPERATIONAL_STATE); raw->sleep = unpack_float_value (en, FLOAT_TYPE_SLEEP); if (mode == PACK_MODE_SERVER_SESSION) { raw->distance = unpack_float_value (en, FLOAT_TYPE_DISTANCE); // only needed by server? } ///////////////////////////////////////////////////////////////// if (raw->operational_state == OPERATIONAL_STATE_LANDED) { raw->loading_door_state = unpack_float_value (en, FLOAT_TYPE_LOADING_DOOR_STATE); } ///////////////////////////////////////////////////////////////// // radar_rotation_state if (mode == PACK_MODE_SERVER_SESSION) { raw->death_timer = unpack_float_value (en, FLOAT_TYPE_DEATH_TIMER); raw->target_fire_timer = unpack_float_value (en, FLOAT_TYPE_TARGET_FIRE_TIMER); raw->target_scan_timer = unpack_float_value (en, FLOAT_TYPE_TARGET_SCAN_TIMER); } // view_interest_level // weapon_burst_timer raw->weapon_system_ready_state = unpack_float_value (en, FLOAT_TYPE_WEAPON_SYSTEM_READY_STATE); if (mode == PACK_MODE_SERVER_SESSION) { raw->decoy_release_timer = unpack_float_value (en, FLOAT_TYPE_DECOY_RELEASE_TIMER); } //////////////////////////////////////// raw->weapon_config_type = (weapon_config_types) unpack_int_value (en, INT_TYPE_WEAPON_CONFIG_TYPE); raw->weapon_package_status_array = (weapon_package_status *) malloc_fast_mem (SIZE_WEAPON_PACKAGE_STATUS_ARRAY); memset (raw->weapon_package_status_array, 0, SIZE_WEAPON_PACKAGE_STATUS_ARRAY); for (package = 0; package < NUM_WEAPON_PACKAGES; package++) { if (weapon_config_database[raw->weapon_config_type][package].sub_type == ENTITY_SUB_TYPE_WEAPON_NO_WEAPON) { break; } raw->weapon_package_status_array[package].number = unpack_int_value (en, INT_TYPE_WEAPON_PACKAGE_NUMBER); raw->weapon_package_status_array[package].damaged = unpack_int_value (en, INT_TYPE_WEAPON_PACKAGE_DAMAGED); if (weapon_config_database[raw->weapon_config_type][package].rotate) { raw->weapon_package_status_array[package].weapon_system_heading = unpack_float_value (en, FLOAT_TYPE_WEAPON_SYSTEM_HEADING); raw->weapon_package_status_array[package].weapon_system_pitch = unpack_float_value (en, FLOAT_TYPE_WEAPON_SYSTEM_PITCH); } // muzzle_flash_timer } reset_entity_weapon_config_animation (en); raw->selected_weapon = unpack_int_value (en, INT_TYPE_SELECTED_WEAPON); //////////////////////////////////////// // sound_effect_data raw->formation_position = unpack_int_value (en, INT_TYPE_FORMATION_POSITION); // selected_weapon_system_ready // weapon_and_target_vectors_valid // gunship_radar_los_clear // los_to_target raw->lights_on = unpack_int_value (en, INT_TYPE_LIGHTS_ON); // cpg_identified raw->group_member_number = unpack_int_value (en, INT_TYPE_GROUP_MEMBER_NUMBER); // id_number_significant_digits raw->damage_level = unpack_int_value (en, INT_TYPE_DAMAGE_LEVEL); // id_number raw->weapon_vector.x = 0.0; raw->weapon_vector.y = 0.0; raw->weapon_vector.z = 1.0; raw->weapon_to_target_vector.x = 0.0; raw->weapon_to_target_vector.y = 0.0; raw->weapon_to_target_vector.z = -1.0; // terrain_info break; } //////////////////////////////////////// case PACK_MODE_BROWSE_SESSION: //////////////////////////////////////// { break; } //////////////////////////////////////// case PACK_MODE_UPDATE_ENTITY: //////////////////////////////////////// { // // cannot update entity at this level as the update may not apply to all entity types below // break; } } }
void unpack_local_force_data (entity *en, pack_modes mode) { int count, loop; force *raw; campaign_criteria_type *last_campaign_criteria, *campaign_criteria; ASSERT ((mode >= 0) && (mode < NUM_PACK_MODES)); ASSERT (en); raw = (force *) get_local_entity_data (en); switch (mode) { //////////////////////////////////////// case PACK_MODE_SERVER_SESSION: //////////////////////////////////////// { unpack_string (en, STRING_TYPE_FORCE_NAME, raw->force_name); // keysite_force // pilot root unpack_list_root (en, LIST_TYPE_DIVISION, &raw->division_root); unpack_list_root (en, LIST_TYPE_CAMPAIGN_OBJECTIVE, &raw->campaign_objective_root); // air_registry_root // ground_registry_root // sea_registry_root // unpack_list_root (en, LIST_TYPE_INDEPENDENT_GROUP, &raw->independent_group_root); // force_link // update link // task generation ////////////////////////////////////////////// for (loop = 0; loop < NUM_ENTITY_SUB_TYPE_TASKS; loop ++) { raw->task_generation [loop].valid = unpack_int_value (en, INT_TYPE_VALID); raw->task_generation [loop].created = unpack_int_value (en, INT_TYPE_TASK_GENERATION); } ///////////////////////////////////////////////////////////////// // campaign criteria //////////////////////////////////////////// count = unpack_int_value (en, INT_TYPE_CAMPAIGN_CRITERIA_COUNT); last_campaign_criteria = NULL; while (count) { campaign_criteria = (campaign_criteria_type *) malloc_heap_mem (sizeof (campaign_criteria_type)); memset (campaign_criteria, 0, sizeof (campaign_criteria_type)); campaign_criteria->criteria_type = unpack_int_value (en, INT_TYPE_CAMPAIGN_CRITERIA_TYPE); campaign_criteria->valid = unpack_int_value (en, INT_TYPE_VALID); campaign_criteria->result = unpack_int_value (en, INT_TYPE_CAMPAIGN_CRITERIA_RESULT); campaign_criteria->value1 = unpack_int_value (en, INT_TYPE_CAMPAIGN_CRITERIA_VALUE); campaign_criteria->value2 = unpack_int_value (en, INT_TYPE_CAMPAIGN_CRITERIA_VALUE); campaign_criteria->value3 = unpack_int_value (en, INT_TYPE_CAMPAIGN_CRITERIA_VALUE); campaign_criteria->value4 = unpack_int_value (en, INT_TYPE_CAMPAIGN_CRITERIA_VALUE); campaign_criteria->next = last_campaign_criteria; raw->campaign_criteria = campaign_criteria; last_campaign_criteria = campaign_criteria; count --; } ///////////////////////////////////////////////////////////////// // force_info_criteria for (loop = 0; loop < NUM_FORCE_INFO_CATAGORIES; loop ++) { raw->force_info_current_hardware [loop] = unpack_int_value (en, INT_TYPE_VALUE); raw->force_info_reserve_hardware [loop] = unpack_int_value (en, INT_TYPE_VALUE); } ///////////////////////////////////////////////////////////////// for (loop = 0; loop < NUM_ENTITY_SUB_TYPE_GROUPS; loop ++) { raw->kills [loop] = unpack_int_value (en, INT_TYPE_VALUE); raw->losses [loop] = unpack_int_value (en, INT_TYPE_VALUE); // raw->group_count [loop] = unpack_int_value (en, INT_TYPE_VALUE); } raw->sleep = unpack_float_value (en, FLOAT_TYPE_SLEEP); raw->force_attitude = unpack_int_value (en, INT_TYPE_FORCE_ATTITUDE); // sector_count raw->colour = unpack_int_value (en, INT_TYPE_COLOUR); raw->side = unpack_int_value (en, INT_TYPE_SIDE); break; } //////////////////////////////////////// case PACK_MODE_CLIENT_SESSION: //////////////////////////////////////// { // // create entity // debug_assert (get_free_entity (get_local_entity_safe_index (en))); set_local_entity_type (en, ENTITY_TYPE_FORCE); raw = (force *) malloc_fast_mem (sizeof (force)); set_local_entity_data (en, raw); memset (raw, 0, sizeof (force)); // // unpack data (in exactly the same order as the data was packed) // unpack_string (en, STRING_TYPE_FORCE_NAME, raw->force_name); // keysite_force unpack_list_root (en, LIST_TYPE_PILOT, &raw->pilot_root); unpack_list_root (en, LIST_TYPE_DIVISION, &raw->division_root); unpack_list_root (en, LIST_TYPE_CAMPAIGN_OBJECTIVE, &raw->campaign_objective_root); // air_registry_root // ground_registry_root // sea_registry_root // unpack_list_root (en, LIST_TYPE_INDEPENDENT_GROUP, &raw->independent_group_root); unpack_list_link (en, LIST_TYPE_FORCE, &raw->force_link); // update_link //////////////////////////////////////////// // task_generation for (loop = 0; loop < NUM_ENTITY_SUB_TYPE_TASKS; loop ++) { raw->task_generation [loop].valid = unpack_int_value (en, INT_TYPE_VALID); raw->task_generation [loop].created = unpack_int_value (en, INT_TYPE_TASK_GENERATION); } //////////////////////////////////////////// //////////////////////////////////////////// // campaign criteria raw->campaign_criteria = NULL; count = unpack_int_value (en, INT_TYPE_CAMPAIGN_CRITERIA_COUNT); while (count) { count --; campaign_criteria = (campaign_criteria_type *) malloc_heap_mem (sizeof (campaign_criteria_type)); memset (campaign_criteria, 0, sizeof (campaign_criteria_type)); campaign_criteria->next = raw->campaign_criteria; raw->campaign_criteria = campaign_criteria; campaign_criteria->criteria_type = unpack_int_value (en, INT_TYPE_CAMPAIGN_CRITERIA_TYPE); campaign_criteria->valid = unpack_int_value (en, INT_TYPE_VALID); campaign_criteria->result = unpack_int_value (en, INT_TYPE_CAMPAIGN_CRITERIA_RESULT); campaign_criteria->value1 = unpack_int_value (en, INT_TYPE_CAMPAIGN_CRITERIA_VALUE); campaign_criteria->value2 = unpack_int_value (en, INT_TYPE_CAMPAIGN_CRITERIA_VALUE); campaign_criteria->value3 = unpack_int_value (en, INT_TYPE_CAMPAIGN_CRITERIA_VALUE); campaign_criteria->value4 = unpack_int_value (en, INT_TYPE_CAMPAIGN_CRITERIA_VALUE); } ///////////////////////////////////////////////////////////////// //////////////////////////////////////////// // force_info_criteria for (loop = 0; loop < NUM_FORCE_INFO_CATAGORIES; loop ++) { raw->force_info_current_hardware [loop] = unpack_int_value (en, INT_TYPE_VALUE); raw->force_info_reserve_hardware [loop] = unpack_int_value (en, INT_TYPE_VALUE); } // force_info_criteria for (loop = 0; loop < NUM_ENTITY_SUB_TYPE_GROUPS; loop ++) { raw->kills [loop] = unpack_int_value (en, INT_TYPE_VALUE); raw->losses [loop] = unpack_int_value (en, INT_TYPE_VALUE); // raw->group_count [loop] = unpack_int_value (en, INT_TYPE_VALUE); } raw->sleep = unpack_float_value (en, FLOAT_TYPE_SLEEP); raw->force_attitude = unpack_int_value (en, INT_TYPE_FORCE_ATTITUDE); raw->sector_count = unpack_int_value (en, INT_TYPE_FORCE_SECTOR_COUNT); raw->colour = unpack_int_value (en, INT_TYPE_COLOUR); raw->side = unpack_int_value (en, INT_TYPE_SIDE); insert_local_entity_into_parents_child_list (en, LIST_TYPE_UPDATE, get_update_entity (), NULL); break; } //////////////////////////////////////// case PACK_MODE_BROWSE_SESSION: //////////////////////////////////////// { // // create entity // debug_assert (get_free_entity (get_local_entity_safe_index (en))); set_local_entity_type (en, ENTITY_TYPE_FORCE); raw = (force *) malloc_fast_mem (sizeof (force)); set_local_entity_data (en, raw); memset (raw, 0, sizeof (force)); // // unpack data (in exactly the same order as the data was packed) // unpack_string (en, STRING_TYPE_FORCE_NAME, raw->force_name); // keysite_force_root unpack_list_root (en, LIST_TYPE_PILOT, &raw->pilot_root); unpack_list_link (en, LIST_TYPE_FORCE, &raw->force_link); // update_link // task_generation // campaign_criteria // force_info_catagories // sleep raw->force_attitude = unpack_int_value (en, INT_TYPE_FORCE_ATTITUDE); raw->colour = unpack_int_value (en, INT_TYPE_COLOUR); raw->side = unpack_int_value (en, INT_TYPE_SIDE); break; } } }
static void unpack_local_data (entity *en, entity_types type, pack_modes mode) { ASSERT ((mode >= 0) && (mode < NUM_PACK_MODES)); switch (mode) { //////////////////////////////////////// case PACK_MODE_SERVER_SESSION: //////////////////////////////////////// { break; } //////////////////////////////////////// case PACK_MODE_CLIENT_SESSION: //////////////////////////////////////// { int index; pilot *raw; // // create entity // index = unpack_entity_safe_index (); en = get_free_entity (index); set_local_entity_type (en, type); raw = malloc_fast_mem (sizeof (pilot)); set_local_entity_data (en, raw); memset (raw, 0, sizeof (pilot)); // // unpack data (in exactly the same order as the data was packed) // raw->sub_type = unpack_int_value (en, INT_TYPE_ENTITY_SUB_TYPE); unpack_string (en, STRING_TYPE_PILOTS_NAME, raw->pilots_name); raw->rank = unpack_int_value (en, INT_TYPE_PILOT_RANK); raw->kills = unpack_int_value (en, INT_TYPE_KILLS); raw->unique_id = unpack_int_value (en, INT_TYPE_UNIQUE_ID); raw->crew_role = CREW_ROLE_PILOT; unpack_list_root (en, LIST_TYPE_PILOT_LOCK, &raw->pilot_lock_root); unpack_list_link (en, LIST_TYPE_AIRCREW, &raw->aircrew_link); unpack_list_link (en, LIST_TYPE_PILOT, &raw->pilot_link); unpack_list_link (en, LIST_TYPE_PLAYER_TASK, &raw->player_task_link); raw->side = unpack_int_value (en, INT_TYPE_SIDE); raw->difficulty_level = unpack_int_value (en, INT_TYPE_DIFFICULTY_LEVEL); break; } //////////////////////////////////////// case PACK_MODE_BROWSE_SESSION: //////////////////////////////////////// { int index; pilot *raw; // // create entity // index = unpack_entity_safe_index (); en = get_free_entity (index); set_local_entity_type (en, type); raw = malloc_fast_mem (sizeof (pilot)); set_local_entity_data (en, raw); memset (raw, 0, sizeof (pilot)); // // unpack data (in exactly the same order as the data was packed) // raw->sub_type = unpack_int_value (en, INT_TYPE_ENTITY_SUB_TYPE); unpack_string (en, STRING_TYPE_PILOTS_NAME, raw->pilots_name); raw->rank = unpack_int_value (en, INT_TYPE_PILOT_RANK); raw->kills = unpack_int_value (en, INT_TYPE_KILLS); raw->unique_id = unpack_int_value (en, INT_TYPE_UNIQUE_ID); raw->crew_role = CREW_ROLE_PILOT; // aircrew_link unpack_list_link (en, LIST_TYPE_PILOT, &raw->pilot_link); raw->side = unpack_int_value (en, INT_TYPE_SIDE); break; } //////////////////////////////////////// case PACK_MODE_UPDATE_ENTITY: //////////////////////////////////////// { // // always use access functions to set the data // break; } } }