Fix vehicle spawner (#95)
Some checks are pending
Nightly Build / Build Nightly (push) Waiting to run
Nightly Build / Recreate Release (push) Blocked by required conditions
Nightly Build / Check Recent Commit (push) Successful in 2m24s

This commit is contained in:
Mr-X-GTA
2025-02-06 13:06:53 +01:00
committed by GitHub
parent 7064995875
commit c8e6a6970b
3 changed files with 14 additions and 13 deletions

View File

@ -17,7 +17,7 @@ jobs:
runs-on: windows-latest runs-on: windows-latest
name: CI name: CI
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: Check CMake version - name: Check CMake version
run: cmake --version run: cmake --version
@ -45,13 +45,13 @@ jobs:
working-directory: build/ working-directory: build/
- name: Upload Artifact (dll) - name: Upload Artifact (dll)
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v4
with: with:
name: binary name: binary
path: | path: |
build/YimMenu-dev-*.dll build/YimMenu-dev-*.dll
- name: Upload Artifact (pdb) - name: Upload Artifact (pdb)
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v4
with: with:
name: pdb name: pdb
path: | path: |

View File

@ -17,7 +17,7 @@ jobs:
outputs: outputs:
should_run: ${{ steps.should_run.outputs.should_run }} should_run: ${{ steps.should_run.outputs.should_run }}
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- id: should_run - id: should_run
name: Check if latest commit date is within the previous 24 hours name: Check if latest commit date is within the previous 24 hours
@ -37,7 +37,7 @@ jobs:
full_sha: ${{ steps.var.outputs.full_sha }} full_sha: ${{ steps.var.outputs.full_sha }}
short_sha: ${{ steps.var.outputs.short_sha }} short_sha: ${{ steps.var.outputs.short_sha }}
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
with: with:
submodules: recursive submodules: recursive
@ -56,7 +56,7 @@ jobs:
run: cmake --build ./build --config RelWithDebInfo --target YimMenu -- run: cmake --build ./build --config RelWithDebInfo --target YimMenu --
- name: Upload Artifact - name: Upload Artifact
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v4
with: with:
name: binary name: binary
path: | path: |
@ -75,7 +75,7 @@ jobs:
needs: build_nightly needs: build_nightly
if: needs.check_recent_commit.outputs.should_run == 'true' if: needs.check_recent_commit.outputs.should_run == 'true'
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: Delete Existing Release - name: Delete Existing Release
id: delete_release id: delete_release
@ -119,7 +119,7 @@ jobs:
} }
- name: Download Artifact - name: Download Artifact
uses: actions/download-artifact@v3 uses: actions/download-artifact@v4
with: with:
name: binary name: binary

View File

@ -165,12 +165,13 @@ namespace big
for (auto& item : calculated_map) for (auto& item : calculated_map)
{ {
const auto& vehicle = item.second; const auto& vehicle = item.second;
ImGui::PushID(vehicle.m_hash); const auto vehicle_hash = vehicle.m_hash;
components::selectable(vehicle.m_display_name, false, [&vehicle] { ImGui::PushID(vehicle_hash);
const auto spawn_location = vehicle::get_spawn_location(g.spawn_vehicle.spawn_inside, vehicle.m_hash); components::selectable(vehicle.m_display_name, false, [vehicle_hash] {
const auto spawn_location = vehicle::get_spawn_location(g.spawn_vehicle.spawn_inside, vehicle_hash);
const auto spawn_heading = ENTITY::GET_ENTITY_HEADING(self::ped); const auto spawn_heading = ENTITY::GET_ENTITY_HEADING(self::ped);
auto veh = vehicle::spawn(vehicle.m_hash, spawn_location, spawn_heading); auto veh = vehicle::spawn(vehicle_hash, spawn_location, spawn_heading);
if (veh == 0) if (veh == 0)
{ {
@ -202,7 +203,7 @@ namespace big
} }
else if (ImGui::IsItemHovered()) else if (ImGui::IsItemHovered())
{ {
g_model_preview_service->show_vehicle(vehicle.m_hash, g.spawn_vehicle.spawn_maxed); g_model_preview_service->show_vehicle(vehicle_hash, g.spawn_vehicle.spawn_maxed);
} }
} }
} }