mirror of
https://github.com/Mr-X-GTA/YimMenu.git
synced 2025-06-23 01:02:23 +08:00
Fix vehicle spawner (#95)
This commit is contained in:
6
.github/workflows/ci.yml
vendored
6
.github/workflows/ci.yml
vendored
@ -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: |
|
||||||
|
10
.github/workflows/nightly.yml
vendored
10
.github/workflows/nightly.yml
vendored
@ -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
|
||||||
|
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user