From 0de9182735fd952febe5fb9bd9f447502df64764 Mon Sep 17 00:00:00 2001 From: YimMenuTheBest <129180905+YimMenuTheBest@users.noreply.github.com> Date: Mon, 23 Oct 2023 15:33:01 -0600 Subject: [PATCH] refactor(IPL's): fix crashes and general improvements (#2304) --- src/core/data/ipls.hpp | 81 ++++++++++++++++++++++++++++---- src/views/self/view_teleport.cpp | 74 ++++++++++++++++++----------- 2 files changed, 118 insertions(+), 37 deletions(-) diff --git a/src/core/data/ipls.hpp b/src/core/data/ipls.hpp index d1ef23a5..cfd355c0 100644 --- a/src/core/data/ipls.hpp +++ b/src/core/data/ipls.hpp @@ -5,18 +5,79 @@ struct ipl_libary const char* friendly_name; Vector3 location; std::vector ipl_names; + std::vector ipl_names_remove; + std::vector ipl_names_remove_when_load; }; // thanks to https://github.com/DurtyFree/gta-v-data-dumps const ipl_libary ipls[] = { - {"North Yankton", {3211.42, -4836.89, 111.81}, {{"prologue01"}, {"prologue01c"}, {"prologue01d"}, {"prologue01e"}, {"prologue01f"}, {"prologue01g"}, {"prologue01h"}, {"prologue01i"}, {"prologue01j"}, {"prologue01k"}, {"prologue01z"}, {"prologue02"}, {"prologue03"}, {"prologue03_grv_cov"}, {"prologue03_grv_dug"}, {"prologue03_grv_fun"}, {"prologue03b"}, {"prologue_grv_torch"}, {"des_protree_end"}, {"des_protree_start"}, {"prologue04"}, {"prologue04_cover"}, {"prologue04b"}, {"prologue05"}, {"prologue05b"}, {"prologue06"}, {"prologue06_int"}, {"prologue06_pannel"}, {"prologue06b"}, {"prologue_m2_door"}, {"prologue_occl"}, {"prologuerd"}, {"prologuerdb"}}}, - {"Cayo Perico", {4915.78, -4907.40, 3.39}, {{"h4_islandx_terrain_01_lod"}, {"h4_islandx_terrain_01_slod"}, {"h4_islandx_terrain_02"}, {"h4_islandx_terrain_02_lod"}, {"h4_islandx_terrain_02_slod"}, {"h4_islandx_terrain_03"}, {"h4_islandx_terrain_03_lod"}, {"h4_islandx_terrain_04"}, {"h4_islandx_terrain_04_lod"}, {"h4_islandx_terrain_04_slod"}, {"h4_islandx_terrain_05"}, {"h4_islandx_terrain_05_lod"}, {"h4_islandx_terrain_05_slod"}, {"h4_islandx_terrain_06"}, {"h4_mph4_terrain_01_grass_0"}, {"h4_mph4_terrain_01_grass_1"}, {"h4_mph4_terrain_02_grass_0"}, {"h4_mph4_terrain_02_grass_1"}, {"h4_mph4_terrain_02_grass_2"}, {"h4_mph4_terrain_02_grass_3"}, {"h4_mph4_terrain_04_grass_0"}, {"h4_mph4_terrain_04_grass_1"}, {"h4_mph4_terrain_05_grass_0"}, {"h4_mph4_terrain_06_grass_0"}, {"h4_islandx_terrain_06_lod"}, {"h4_islandx_terrain_06_slod"}, {"h4_islandx_terrain_props_05_a"}, {"h4_islandx_terrain_props_05_a_lod"}, {"h4_islandx_terrain_props_05_b"}, {"h4_islandx_terrain_props_05_b_lod"}, {"h4_islandx_terrain_props_05_c"}, {"h4_islandx_terrain_props_05_c_lod"}, {"h4_islandx_terrain_props_05_d"}, {"h4_islandx_terrain_props_05_d_lod"}, {"h4_islandx_terrain_props_05_d_slod"}, {"h4_islandx_terrain_props_05_e"}, {"h4_islandx_terrain_props_05_e_lod"}, {"h4_islandx_terrain_props_05_e_slod"}, {"h4_islandx_terrain_props_05_f"}, {"h4_islandx_terrain_props_05_f_lod"}, {"h4_islandx_terrain_props_05_f_slod"}, {"h4_islandx_terrain_props_06_a"}, {"h4_islandx_terrain_props_06_a_lod"}, {"h4_islandx_terrain_props_06_a_slod"}, {"h4_islandx_terrain_props_06_b"}, {"h4_islandx_terrain_props_06_b_lod"}, {"h4_islandx_terrain_props_06_b_slod"}, {"h4_islandx_terrain_props_06_c"}, {"h4_islandx_terrain_props_06_c_lod"}, {"h4_islandx_terrain_props_06_c_slod"}, {"h4_mph4_terrain_01"}, {"h4_mph4_terrain_01_long_0"}, {"h4_mph4_terrain_02"}, {"h4_mph4_terrain_03"}, {"h4_mph4_terrain_04"}, {"h4_mph4_terrain_05"}, {"h4_mph4_terrain_06"}, {"h4_mph4_terrain_06_strm_0"}, {"h4_mph4_terrain_lod"}, {"h4_mph4_terrain_occ_00"}, {"h4_mph4_terrain_occ_01"}, {"h4_mph4_terrain_occ_02"}, {"h4_mph4_terrain_occ_03"}, {"h4_mph4_terrain_occ_04"}, {"h4_mph4_terrain_occ_05"}, {"h4_mph4_terrain_occ_06"}, {"h4_mph4_terrain_occ_07"}, {"h4_mph4_terrain_occ_08"}, {"h4_mph4_terrain_occ_09"}, {"h4_boatblockers"}, {"h4_islandx"}, {"h4_islandx_disc_strandedshark"}, {"h4_islandx_disc_strandedshark_lod"}, {"h4_islandx_disc_strandedwhale"}, {"h4_islandx_disc_strandedwhale_lod"}, {"h4_islandx_props"}, {"h4_islandx_props_lod"}, {"h4_islandx_sea_mines"}, {"h4_mph4_island"}, {"h4_mph4_island_long_0"}, {"h4_mph4_island_strm_0"}, {"h4_aa_guns"}, {"h4_aa_guns_lod"}, {"h4_beach"}, {"h4_beach_bar_props"}, {"h4_beach_lod"}, {"h4_beach_party"}, {"h4_beach_party_lod"}, {"h4_beach_props"}, {"h4_beach_props_lod"}, {"h4_beach_props_party"}, {"h4_beach_props_slod"}, {"h4_beach_slod"}, {"h4_islandairstrip"}, {"h4_islandairstrip_doorsclosed"}, {"h4_islandairstrip_doorsclosed_lod"}, {"h4_islandairstrip_doorsopen"}, {"h4_islandairstrip_doorsopen_lod"}, {"h4_islandairstrip_hangar_props"}, {"h4_islandairstrip_hangar_props_lod"}, {"h4_islandairstrip_hangar_props_slod"}, {"h4_islandairstrip_lod"}, {"h4_islandairstrip_props"}, {"h4_islandairstrip_propsb"}, {"h4_islandairstrip_propsb_lod"}, {"h4_islandairstrip_propsb_slod"}, {"h4_islandairstrip_props_lod"}, {"h4_islandairstrip_props_slod"}, {"h4_islandairstrip_slod"}, {"h4_islandxcanal_props"}, {"h4_islandxcanal_props_lod"}, {"h4_islandxcanal_props_slod"}, {"h4_islandxdock"}, {"h4_islandxdock_lod"}, {"h4_islandxdock_props"}, {"h4_islandxdock_props_2"}, {"h4_islandxdock_props_2_lod"}, {"h4_islandxdock_props_2_slod"}, {"h4_islandxdock_props_lod"}, {"h4_islandxdock_props_slod"}, {"h4_islandxdock_slod"}, {"h4_islandxdock_water_hatch"}, {"h4_islandxtower"}, {"h4_islandxtower_lod"}, {"h4_islandxtower_slod"}, {"h4_islandxtower_veg"}, {"h4_islandxtower_veg_lod"}, {"h4_islandxtower_veg_slod"}, {"h4_islandx_barrack_hatch"}, {"h4_islandx_barrack_props"}, {"h4_islandx_barrack_props_lod"}, {"h4_islandx_barrack_props_slod"}, {"h4_islandx_checkpoint"}, {"h4_islandx_checkpoint_lod"}, {"h4_islandx_checkpoint_props"}, {"h4_islandx_checkpoint_props_lod"}, {"h4_islandx_checkpoint_props_slod"}, {"h4_islandx_maindock"}, {"h4_islandx_maindock_lod"}, {"h4_islandx_maindock_props"}, {"h4_islandx_maindock_props_2"}, {"h4_islandx_maindock_props_2_lod"}, {"h4_islandx_maindock_props_2_slod"}, {"h4_islandx_maindock_props_lod"}, {"h4_islandx_maindock_props_slod"}, {"h4_islandx_maindock_slod"}, {"h4_islandx_mansion"}, {"h4_islandx_mansion_b"}, {"h4_islandx_mansion_b_lod"}, {"h4_islandx_mansion_b_side_fence"}, {"h4_islandx_mansion_b_slod"}, {"h4_islandx_mansion_entrance_fence"}, {"h4_islandx_mansion_guardfence"}, {"h4_islandx_mansion_lights"}, {"h4_islandx_mansion_lockup_01"}, {"h4_islandx_mansion_lockup_01_lod"}, {"h4_islandx_mansion_lockup_02"}, {"h4_islandx_mansion_lockup_02_lod"}, {"h4_islandx_mansion_lockup_03"}, {"h4_islandx_mansion_lockup_03_lod"}, {"h4_islandx_mansion_lod"}, {"h4_islandx_mansion_office"}, {"h4_islandx_mansion_office_lod"}, {"h4_islandx_mansion_props"}, {"h4_islandx_mansion_props_lod"}, {"h4_islandx_mansion_props_slod"}, {"h4_islandx_mansion_slod"}, {"h4_islandx_mansion_vault"}, {"h4_islandx_mansion_vault_lod"}, {"h4_island_padlock_props"}, {"h4_mansion_gate_broken"}, {"h4_mansion_gate_closed"}, {"h4_mansion_remains_cage"}, {"h4_mph4_airstrip"}, {"h4_mph4_airstrip_interior_0_airstrip_hanger"}, {"h4_mph4_beach"}, {"h4_mph4_dock"}, {"h4_mph4_island_lod"}, {"h4_mph4_island_ne_placement"}, {"h4_mph4_island_nw_placement"}, {"h4_mph4_island_se_placement"}, {"h4_mph4_island_sw_placement"}, {"h4_mph4_mansion"}, {"h4_mph4_mansion_b"}, {"h4_mph4_mansion_b_strm_0"}, {"h4_mph4_mansion_strm_0"}, {"h4_mph4_wtowers"}, {"h4_ne_ipl_00"}, {"h4_ne_ipl_00_lod"}, {"h4_ne_ipl_00_slod"}, {"h4_ne_ipl_01"}, {"h4_ne_ipl_01_lod"}, {"h4_ne_ipl_01_slod"}, {"h4_ne_ipl_02"}, {"h4_ne_ipl_02_lod"}, {"h4_ne_ipl_02_slod"}, {"h4_ne_ipl_03"}, {"h4_ne_ipl_03_lod"}, {"h4_ne_ipl_03_slod"}, {"h4_ne_ipl_04"}, {"h4_ne_ipl_04_lod"}, {"h4_ne_ipl_04_slod"}, {"h4_ne_ipl_05"}, {"h4_ne_ipl_05_lod"}, {"h4_ne_ipl_05_slod"}, {"h4_ne_ipl_06"}, {"h4_ne_ipl_06_lod"}, {"h4_ne_ipl_06_slod"}, {"h4_ne_ipl_07"}, {"h4_ne_ipl_07_lod"}, {"h4_ne_ipl_07_slod"}, {"h4_ne_ipl_08"}, {"h4_ne_ipl_08_lod"}, {"h4_ne_ipl_08_slod"}, {"h4_ne_ipl_09"}, {"h4_ne_ipl_09_lod"}, {"h4_ne_ipl_09_slod"}, {"h4_nw_ipl_00"}, {"h4_nw_ipl_00_lod"}, {"h4_nw_ipl_00_slod"}, {"h4_nw_ipl_01"}, {"h4_nw_ipl_01_lod"}, {"h4_nw_ipl_01_slod"}, {"h4_nw_ipl_02"}, {"h4_nw_ipl_02_lod"}, {"h4_nw_ipl_02_slod"}, {"h4_nw_ipl_03"}, {"h4_nw_ipl_03_lod"}, {"h4_nw_ipl_03_slod"}, {"h4_nw_ipl_04"}, {"h4_nw_ipl_04_lod"}, {"h4_nw_ipl_04_slod"}, {"h4_nw_ipl_05"}, {"h4_nw_ipl_05_lod"}, {"h4_nw_ipl_05_slod"}, {"h4_nw_ipl_06"}, {"h4_nw_ipl_06_lod"}, {"h4_nw_ipl_06_slod"}, {"h4_nw_ipl_07"}, {"h4_nw_ipl_07_lod"}, {"h4_nw_ipl_07_slod"}, {"h4_nw_ipl_08"}, {"h4_nw_ipl_08_lod"}, {"h4_nw_ipl_08_slod"}, {"h4_nw_ipl_09"}, {"h4_nw_ipl_09_lod"}, {"h4_nw_ipl_09_slod"}, {"h4_se_ipl_00"}, {"h4_se_ipl_00_lod"}, {"h4_se_ipl_00_slod"}, {"h4_se_ipl_01"}, {"h4_se_ipl_01_lod"}, {"h4_se_ipl_01_slod"}, {"h4_se_ipl_02"}, {"h4_se_ipl_02_lod"}, {"h4_se_ipl_02_slod"}, {"h4_se_ipl_03"}, {"h4_se_ipl_03_lod"}, {"h4_se_ipl_03_slod"}, {"h4_se_ipl_04"}, {"h4_se_ipl_04_lod"}, {"h4_se_ipl_04_slod"}, {"h4_se_ipl_05"}, {"h4_se_ipl_05_lod"}, {"h4_se_ipl_05_slod"}, {"h4_se_ipl_06"}, {"h4_se_ipl_06_lod"}, {"h4_se_ipl_06_slod"}, {"h4_se_ipl_07"}, {"h4_se_ipl_07_lod"}, {"h4_se_ipl_07_slod"}, {"h4_se_ipl_08"}, {"h4_se_ipl_08_lod"}, {"h4_se_ipl_08_slod"}, {"h4_se_ipl_09"}, {"h4_se_ipl_09_lod"}, {"h4_se_ipl_09_slod"}, {"h4_sw_ipl_00"}, {"h4_sw_ipl_00_lod"}, {"h4_sw_ipl_00_slod"}, {"h4_sw_ipl_01"}, {"h4_sw_ipl_01_lod"}, {"h4_sw_ipl_01_slod"}, {"h4_sw_ipl_02"}, {"h4_sw_ipl_02_lod"}, {"h4_sw_ipl_02_slod"}, {"h4_sw_ipl_03"}, {"h4_sw_ipl_03_lod"}, {"h4_sw_ipl_03_slod"}, {"h4_sw_ipl_04"}, {"h4_sw_ipl_04_lod"}, {"h4_sw_ipl_04_slod"}, {"h4_sw_ipl_05"}, {"h4_sw_ipl_05_lod"}, {"h4_sw_ipl_05_slod"}, {"h4_sw_ipl_06"}, {"h4_sw_ipl_06_lod"}, {"h4_sw_ipl_06_slod"}, {"h4_sw_ipl_07"}, {"h4_sw_ipl_07_lod"}, {"h4_sw_ipl_07_slod"}, {"h4_sw_ipl_08"}, {"h4_sw_ipl_08_lod"}, {"h4_sw_ipl_08_slod"}, {"h4_sw_ipl_09"}, {"h4_sw_ipl_09_lod"}, {"h4_sw_ipl_09_slod"}, {"h4_underwater_gate_closed"}, {"h4_islandx_placement_01"}, {"h4_islandx_placement_02"}, {"h4_islandx_placement_03"}, {"h4_islandx_placement_04"}, {"h4_islandx_placement_05"}, {"h4_islandx_placement_06"}, {"h4_islandx_placement_07"}, {"h4_islandx_placement_08"}, {"h4_islandx_placement_09"}, {"h4_islandx_placement_10"}, {"h4_mph4_island_placement"}}}, - {"Dignity Party Yacht", {-2045.8, -1031.2, 11.9}, {{"smboat"}, {"apa_smboat_lodlights"}, {"ba_sm_boat_window"}}}, - {"Aircraft Carrier", {3069.33, -4632.4, 15.04}, {{"hei_carrier_lodlights"}, {"hei_carrier"}, {"hei_carrier_int1"}, {"hei_carrier_int2"}, {"hei_carrier_int3"}, {"hei_carrier_int4"}, {"hei_carrier_int5"}, {"hei_carrier_int6"}}}, - {"Cargoship", {-162.89, -2365.76, 0.0}, {{"ship_occ_grp1"}, {"ship_occ_grp2"}, {"cargoship"}, {"sunk_ship_fire"}, {"sunkcargoship"}}}, - {"Destroyed Pillbox Hospital", {356.8, -590.1, 43.3}, {{"rc12b_default"}, {"rc12b_destroyed"}, {"rc12b_fixed"}, {"rc12b_hospitalinterior"}}}, - {"O'Neil Farm", {2441.2, 4968.5, 51.7}, {{"des_farmhouse"}, {"des_farmhs_endimap"}, {"des_farmhs_startimap"}, {"farm"}, {"farm_burnt"}, {"farm_burnt_props"}, {"farm_props"}, {"farmint"}, {"farmint_cap"}, {"des_farmhs_end_occl"}, {"des_farmhs_start_occl"}}}, - {"LifeInvader", {-1047.9, -233.0, 39.0}, {{"facelobby"}, {"facelobbyfake"}}}, - {"Jewelry Store", {-630.4, -236.7, 40.0}, {{"bh1_16_refurb"}, {"jewel2fake"}, {"post_hiest_unload"}}}, - {"Coroner Morgue", {244.9, -1374.7, 39.5}, {{"coroner_int_off"}, {"coroner_int_on"}, {"coronertrash"}}}, + { + "North Yankton", + {3211.42, -4836.89, 111.81}, + {{"prologue01"}, {"prologue01c"}, {"prologue01d"}, {"prologue01e"}, {"prologue01f"}, {"prologue01g"}, {"prologue01h"}, {"prologue01i"}, {"prologue01j"}, {"prologue01k"}, {"prologue01z"}, {"prologue02"}, {"prologue03"}, {"prologue03_grv_cov"}, {"prologue03_grv_dug"}, {"prologue03_grv_fun"}, {"prologue03b"}, {"prologue_grv_torch"}, {"des_protree_end"}, {"des_protree_start"}, {"prologue04"}, {"prologue04_cover"}, {"prologue04b"}, {"prologue05"}, {"prologue05b"}, {"prologue06"}, {"prologue06_int"}, {"prologue06_pannel"}, {"prologue06b"}, {"prologue_m2_door"}, {"prologue_occl"}, {"prologuerd"}, {"prologuerdb"}}, + {{""}}, + {{""}}, + }, // North Yankton + { + "Cayo Perico", + {4915.78, -4907.40, 3.39}, + {{"h4_mph4_terrain_01_grass_0", "h4_mph4_terrain_01_grass_1", "h4_mph4_terrain_02_grass_0", "h4_mph4_terrain_02_grass_1", "h4_mph4_terrain_02_grass_2", "h4_mph4_terrain_02_grass_3", "h4_mph4_terrain_04_grass_0", "h4_mph4_terrain_04_grass_1", "h4_mph4_terrain_05_grass_0", "h4_mph4_terrain_06_grass_0", "h4_islandx_terrain_01", "h4_islandx_terrain_01_lod", "h4_islandx_terrain_01_slod", "h4_islandx_terrain_02", "h4_islandx_terrain_02_lod", "h4_islandx_terrain_02_slod", "h4_islandx_terrain_03", "h4_islandx_terrain_03_lod", "h4_islandx_terrain_04", "h4_islandx_terrain_04_lod", "h4_islandx_terrain_04_slod", "h4_islandx_terrain_05", "h4_islandx_terrain_05_lod", "h4_islandx_terrain_05_slod", "h4_islandx_terrain_06", "h4_islandx_terrain_06_lod", "h4_islandx_terrain_06_slod", "h4_islandx_terrain_props_05_a", "h4_islandx_terrain_props_05_a_lod", "h4_islandx_terrain_props_05_b", "h4_islandx_terrain_props_05_b_lod", "h4_islandx_terrain_props_05_c", "h4_islandx_terrain_props_05_c_lod", "h4_islandx_terrain_props_05_d", "h4_islandx_terrain_props_05_d_lod", "h4_islandx_terrain_props_05_d_slod", "h4_islandx_terrain_props_05_e", "h4_islandx_terrain_props_05_e_lod", "h4_islandx_terrain_props_05_e_slod", "h4_islandx_terrain_props_05_f", "h4_islandx_terrain_props_05_f_lod", "h4_islandx_terrain_props_05_f_slod", "h4_islandx_terrain_props_06_a", "h4_islandx_terrain_props_06_a_lod", "h4_islandx_terrain_props_06_a_slod", "h4_islandx_terrain_props_06_b", "h4_islandx_terrain_props_06_b_lod", "h4_islandx_terrain_props_06_b_slod", "h4_islandx_terrain_props_06_c", "h4_islandx_terrain_props_06_c_lod", "h4_islandx_terrain_props_06_c_slod", "h4_mph4_terrain_01", "h4_mph4_terrain_01_long_0", "h4_mph4_terrain_02", "h4_mph4_terrain_03", "h4_mph4_terrain_04", "h4_mph4_terrain_05", "h4_mph4_terrain_06", "h4_mph4_terrain_06_strm_0", "h4_mph4_terrain_lod", "h4_mph4_terrain_occ_00", "h4_mph4_terrain_occ_01", "h4_mph4_terrain_occ_02", "h4_mph4_terrain_occ_03", "h4_mph4_terrain_occ_04", "h4_mph4_terrain_occ_05", "h4_mph4_terrain_occ_06", "h4_mph4_terrain_occ_07", "h4_mph4_terrain_occ_08", "h4_mph4_terrain_occ_09", "h4_boatblockers", "h4_islandx", "h4_islandx_disc_strandedshark", "h4_islandx_disc_strandedshark_lod", "h4_islandx_disc_strandedwhale", "h4_islandx_disc_strandedwhale_lod", "h4_islandx_props", "h4_islandx_props_lod", "h4_islandx_sea_mines", "h4_mph4_island", "h4_mph4_island_long_0", "h4_mph4_island_strm_0", "h4_aa_guns", "h4_aa_guns_lod", "h4_beach", "h4_beach_bar_props", "h4_beach_lod", "h4_beach_party", "h4_beach_party_lod", "h4_beach_props", "h4_beach_props_lod", "h4_beach_props_party", "h4_beach_props_slod", "h4_beach_slod", "h4_islandairstrip", "h4_islandairstrip_doorsclosed", "h4_islandairstrip_doorsclosed_lod", "h4_islandairstrip_doorsopen", "h4_islandairstrip_doorsopen_lod", "h4_islandairstrip_hangar_props", "h4_islandairstrip_hangar_props_lod", "h4_islandairstrip_hangar_props_slod", "h4_islandairstrip_lod", "h4_islandairstrip_props", "h4_islandairstrip_propsb", "h4_islandairstrip_propsb_lod", "h4_islandairstrip_propsb_slod", "h4_islandairstrip_props_lod", "h4_islandairstrip_props_slod", "h4_islandairstrip_slod", "h4_islandxcanal_props", "h4_islandxcanal_props_lod", "h4_islandxcanal_props_slod", "h4_islandxdock", "h4_islandxdock_lod", "h4_islandxdock_props", "h4_islandxdock_props_2", "h4_islandxdock_props_2_lod", "h4_islandxdock_props_2_slod", "h4_islandxdock_props_lod", "h4_islandxdock_props_slod", "h4_islandxdock_slod", "h4_islandxdock_water_hatch", "h4_islandxtower", "h4_islandxtower_lod", "h4_islandxtower_slod", "h4_islandxtower_veg", "h4_islandxtower_veg_lod", "h4_islandxtower_veg_slod", "h4_islandx_barrack_hatch", "h4_islandx_barrack_props", "h4_islandx_barrack_props_lod", "h4_islandx_barrack_props_slod", "h4_islandx_checkpoint", "h4_islandx_checkpoint_lod", "h4_islandx_checkpoint_props", "h4_islandx_checkpoint_props_lod", "h4_islandx_checkpoint_props_slod", "h4_islandx_maindock", "h4_islandx_maindock_lod", "h4_islandx_maindock_props", "h4_islandx_maindock_props_2", "h4_islandx_maindock_props_2_lod", "h4_islandx_maindock_props_2_slod", "h4_islandx_maindock_props_lod", "h4_islandx_maindock_props_slod", "h4_islandx_maindock_slod", "h4_islandx_mansion", "h4_islandx_mansion_b", "h4_islandx_mansion_b_lod", "h4_islandx_mansion_b_side_fence", "h4_islandx_mansion_b_slod", "h4_islandx_mansion_entrance_fence", "h4_islandx_mansion_guardfence", "h4_islandx_mansion_lights", "h4_islandx_mansion_lockup_01", "h4_islandx_mansion_lockup_01_lod", "h4_islandx_mansion_lockup_02", "h4_islandx_mansion_lockup_02_lod", "h4_islandx_mansion_lockup_03", "h4_islandx_mansion_lockup_03_lod", "h4_islandx_mansion_lod", "h4_islandx_mansion_office", "h4_islandx_mansion_office_lod", "h4_islandx_mansion_props", "h4_islandx_mansion_props_lod", "h4_islandx_mansion_props_slod", "h4_islandx_mansion_slod", "h4_islandx_mansion_vault", "h4_islandx_mansion_vault_lod", "h4_island_padlock_props", "h4_mansion_gate_closed", "h4_mansion_remains_cage", "h4_mph4_airstrip", "h4_mph4_airstrip_interior_0_airstrip_hanger", "h4_mph4_beach", "h4_mph4_dock", "h4_mph4_island_lod", "h4_mph4_island_ne_placement", "h4_mph4_island_nw_placement", "h4_mph4_island_se_placement", "h4_mph4_island_sw_placement", "h4_mph4_mansion", "h4_mph4_mansion_b", "h4_mph4_mansion_b_strm_0", "h4_mph4_mansion_strm_0", "h4_mph4_wtowers", "h4_ne_ipl_00", "h4_ne_ipl_00_lod", "h4_ne_ipl_00_slod", "h4_ne_ipl_01", "h4_ne_ipl_01_lod", "h4_ne_ipl_01_slod", "h4_ne_ipl_02", "h4_ne_ipl_02_lod", "h4_ne_ipl_02_slod", "h4_ne_ipl_03", "h4_ne_ipl_03_lod", "h4_ne_ipl_03_slod", "h4_ne_ipl_04", "h4_ne_ipl_04_lod", "h4_ne_ipl_04_slod", "h4_ne_ipl_05", "h4_ne_ipl_05_lod", "h4_ne_ipl_05_slod", "h4_ne_ipl_06", "h4_ne_ipl_06_lod", "h4_ne_ipl_06_slod", "h4_ne_ipl_07", "h4_ne_ipl_07_lod", "h4_ne_ipl_07_slod", "h4_ne_ipl_08", "h4_ne_ipl_08_lod", "h4_ne_ipl_08_slod", "h4_ne_ipl_09", "h4_ne_ipl_09_lod", "h4_ne_ipl_09_slod", "h4_nw_ipl_00", "h4_nw_ipl_00_lod", "h4_nw_ipl_00_slod", "h4_nw_ipl_01", "h4_nw_ipl_01_lod", "h4_nw_ipl_01_slod", "h4_nw_ipl_02", "h4_nw_ipl_02_lod", "h4_nw_ipl_02_slod", "h4_nw_ipl_03", "h4_nw_ipl_03_lod", "h4_nw_ipl_03_slod", "h4_nw_ipl_04", "h4_nw_ipl_04_lod", "h4_nw_ipl_04_slod", "h4_nw_ipl_05", "h4_nw_ipl_05_lod", "h4_nw_ipl_05_slod", "h4_nw_ipl_06", "h4_nw_ipl_06_lod", "h4_nw_ipl_06_slod", "h4_nw_ipl_07", "h4_nw_ipl_07_lod", "h4_nw_ipl_07_slod", "h4_nw_ipl_08", "h4_nw_ipl_08_lod", "h4_nw_ipl_08_slod", "h4_nw_ipl_09", "h4_nw_ipl_09_lod", "h4_nw_ipl_09_slod", "h4_se_ipl_00", "h4_se_ipl_00_lod", "h4_se_ipl_00_slod", "h4_se_ipl_01", "h4_se_ipl_01_lod", "h4_se_ipl_01_slod", "h4_se_ipl_02", "h4_se_ipl_02_lod", "h4_se_ipl_02_slod", "h4_se_ipl_03", "h4_se_ipl_03_lod", "h4_se_ipl_03_slod", "h4_se_ipl_04", "h4_se_ipl_04_lod", "h4_se_ipl_04_slod", "h4_se_ipl_05", "h4_se_ipl_05_lod", "h4_se_ipl_05_slod", "h4_se_ipl_06", "h4_se_ipl_06_lod", "h4_se_ipl_06_slod", "h4_se_ipl_07", "h4_se_ipl_07_lod", "h4_se_ipl_07_slod", "h4_se_ipl_08", "h4_se_ipl_08_lod", "h4_se_ipl_08_slod", "h4_se_ipl_09", "h4_se_ipl_09_lod", "h4_se_ipl_09_slod", "h4_sw_ipl_00", "h4_sw_ipl_00_lod", "h4_sw_ipl_00_slod", "h4_sw_ipl_01", "h4_sw_ipl_01_lod", "h4_sw_ipl_01_slod", "h4_sw_ipl_02", "h4_sw_ipl_02_lod", "h4_sw_ipl_02_slod", "h4_sw_ipl_03", "h4_sw_ipl_03_lod", "h4_sw_ipl_03_slod", "h4_sw_ipl_04", "h4_sw_ipl_04_lod", "h4_sw_ipl_04_slod", "h4_sw_ipl_05", "h4_sw_ipl_05_lod", "h4_sw_ipl_05_slod", "h4_sw_ipl_06", "h4_sw_ipl_06_lod", "h4_sw_ipl_06_slod", "h4_sw_ipl_07", "h4_sw_ipl_07_lod", "h4_sw_ipl_07_slod", "h4_sw_ipl_08", "h4_sw_ipl_08_lod", "h4_sw_ipl_08_slod", "h4_sw_ipl_09", "h4_sw_ipl_09_lod", "h4_sw_ipl_09_slod", "h4_underwater_gate_closed", "h4_islandx_placement_01", "h4_islandx_placement_02", "h4_islandx_placement_03", "h4_islandx_placement_04", "h4_islandx_placement_05", "h4_islandx_placement_06", "h4_islandx_placement_07", "h4_islandx_placement_08", "h4_islandx_placement_09", "h4_islandx_placement_10", "h4_mph4_island_placement"}}, + {{""}}, + {{""}}, + }, // Cayo Perico Dont Load Interiors Why(? + { + "Dignity Party Yacht", + {-2045.8, -1031.2, 11.9}, + {{"smboat"}, {"apa_smboat_lodlights"}, {"ba_sm_boat_window"}}, + {{""}}, + {{""}}, + }, // Dignity Party Yacht + { + "Aircraft Carrier", + {3069.33, -4632.4, 15.04}, + {{"hei_carrier_lodlights"}, {"hei_carrier"}, {"hei_carrier_int1"}, {"hei_carrier_int2"}, {"hei_carrier_int3"}, {"hei_carrier_int4"}, {"hei_carrier_int5"}, {"hei_carrier_int6"}}, + {{""}}, + {{""}}, + }, // Aircraft Carrier + { + "Sunken Cargo Ship", + {-162.89, -2365.76, 0.0}, + {{"sunk_ship_fire"}, {"sunkcargoship"}}, + {{"cargoship"}}, + {{"cargoship"}}, + }, // Sunken Cargo Ship (Merryweather heist) + { + "Destroyed Pillbox Hospital", + {297.84, -584.41, 43.26}, + {{"rc12b_hospitalinterior"}}, + {{"rc12b_default"}}, + {{"rc12b_default"}}, + }, // Destroyed Pillbox Hospital + { + "O'Neil Farm Destroyed", + {2471.49, 4954.18, 45.12}, + {{"farm_burnt"}, {"farm_burnt_props"}}, + {{"farm"}, {"farmint"}, {"farmint_cap"}, {"farm_props"}, {"des_farmhs_startimap"}}, + {{"farm"}, {"farmint"}, {"farmint_cap"}, {"farm_props"}, {"des_farmhs_startimap"}}, + }, // Farm Destroyed House + { + "LifeInvader Interior", + {-1082.77, -258.67, 37.76}, + {{"facelobby"}}, + {{"facelobbyfake"}}, + {{"facelobbyfake"}}, + }, // LifeInvader Interior + { + "Jewelry Store Interior", + {-630.4, -236.7, 40.0}, + {{"post_hiest_unload"}}, + {{"jewel2fake"}}, + {{"jewel2fake"}, {"bh1_16_refurb"}}, + }, // Jewelry Interior + {"Coroner Morgue Interior", + {244.9, -1374.7, 39.5}, + {{"coroner_int_on"}, {"coronertrash"}}, + {{"coroner_int_off"}}, + {{"coroner_int_off"}}, + }, // Coroner Morgue Interior }; diff --git a/src/views/self/view_teleport.cpp b/src/views/self/view_teleport.cpp index 80352719..912760e0 100644 --- a/src/views/self/view_teleport.cpp +++ b/src/views/self/view_teleport.cpp @@ -93,52 +93,72 @@ namespace big ImGui::SeparatorText("GUI_TAB_IPL"_T.data()); - if (ImGui::BeginCombo("IPL_LOCATION"_T.data(), ipls[g.self.ipls.select].friendly_name)) + static int current_select = -1; + static int last_select = current_select; + + ImGui::SetNextItemWidth(400); + if (ImGui::BeginCombo("##Ipllocation", ipls[current_select].friendly_name)) { for (int i = 0; i < IM_ARRAYSIZE(ipls); i++) { - if (ImGui::Selectable(ipls[i].friendly_name, i == g.self.ipls.select)) - g.self.ipls.select = i; - - if (i == g.self.ipls.select) + bool is_selected = (i == current_select); + if (ImGui::Selectable(ipls[i].friendly_name, is_selected)) + { + current_select = i; + } + if (is_selected) + { ImGui::SetItemDefaultFocus(); + } } - ImGui::EndCombo(); } - - const auto& selected_ipl = ipls[g.self.ipls.select]; - if (components::button("LOAD_IPL"_T)) + ImGui::SameLine(); + components::button("LOAD_IPL"_T, [] { - //unload all previous ipls - for (auto& ipl : ipls) - for (auto& ipl_name : ipl.ipl_names) + // If we've changed selections, first unload previously loaded IPL, then load previously deleted IPLs + if (current_select != last_select) + { + // Unload previously loaded IPL of the last selection + for (auto& ipl_name_unload : ipls[last_select].ipl_names) { - if (STREAMING::IS_IPL_ACTIVE(ipl_name)) + if (STREAMING::IS_IPL_ACTIVE(ipl_name_unload)) { - LOG(INFO) << "unloading existing ipl " << ipl_name; - STREAMING::REMOVE_IPL(ipl_name); + STREAMING::REMOVE_IPL(ipl_name_unload); } } - //load the new ipl - for (auto& ipl_name : selected_ipl.ipl_names) - STREAMING::REQUEST_IPL(ipl_name); - } + // Load previously deleted IPLs of the last selection + for (auto& ipl_name_load : ipls[last_select].ipl_names_remove) + { + STREAMING::REQUEST_IPL(ipl_name_load); + } + // Load new IPLs of the current selection + for (auto& ipl_name : ipls[current_select].ipl_names) + { + STREAMING::REQUEST_IPL(ipl_name); + } + + // Remove old IPLs of the current selection to avoid conflicts + for (auto& ipl_name_remove : ipls[current_select].ipl_names_remove_when_load) + { + STREAMING::REMOVE_IPL(ipl_name_remove); + } + + last_select = current_select; + } + }); ImGui::SameLine(); - - if (components::button("TP_TO_IPL"_T)) + components::button("TP_TO_IPL"_T, [] { - teleport::to_coords(selected_ipl.location); - } + teleport::to_coords(ipls[current_select].location); + }); ImGui::Spacing(); components::small_text("IPL_INFOS"_T); - ImGui::Text(std::vformat("IPL_CNT"_T, std::make_format_args(selected_ipl.ipl_names.size())).data()); - ImGui::Text(std::vformat("IPL_POSITION"_T, - std::make_format_args(selected_ipl.location.x, selected_ipl.location.y, selected_ipl.location.z)) - .data()); + ImGui::Text(std::vformat("IPL_CNT"_T, std::make_format_args(ipls[current_select].ipl_names.size())).data()); + ImGui::Text(std::vformat("IPL_POSITION"_T, std::make_format_args(ipls[current_select].location.x, ipls[current_select].location.y, ipls[current_select].location.z)).data()); } }