From 59a818840ea6318b332acfbeaadd320eb575b6d7 Mon Sep 17 00:00:00 2001 From: astro <15655250+0xFFFFFFFFFFFFFFFFFF@users.noreply.github.com> Date: Tue, 17 Jun 2025 22:22:48 +0200 Subject: [PATCH 1/2] Expose IsPlayerUsingOmp --- apidocs/api.json | 10 ++++++++++ include/ompcapi.h | 3 +++ src/Impl/Players/APIs.cpp | 7 +++++++ 3 files changed, 20 insertions(+) diff --git a/apidocs/api.json b/apidocs/api.json index cb3ee44..3aff9b5 100644 --- a/apidocs/api.json +++ b/apidocs/api.json @@ -3744,6 +3744,16 @@ "type": "void*" } ] + }, + { + "ret": "bool", + "name": "Player_IsPlayerUsingOmp", + "params": [ + { + "name": "player", + "type": "void*" + } + ] } ], "Component": [ diff --git a/include/ompcapi.h b/include/ompcapi.h index 8269643..afad7fa 100644 --- a/include/ompcapi.h +++ b/include/ompcapi.h @@ -317,6 +317,7 @@ typedef int (*Player_GetSirenState_t)(void* player); typedef int (*Player_GetLandingGearState_t)(void* player); typedef uint32_t (*Player_GetHydraReactorAngle_t)(void* player); typedef float (*Player_GetTrainSpeed_t)(void* player); +typedef bool (*Player_IsPlayerUsingOmp_t)(void* player); // Component function type definitions @@ -1743,6 +1744,7 @@ struct Player_t { Player_GetLandingGearState_t GetLandingGearState; Player_GetHydraReactorAngle_t GetHydraReactorAngle; Player_GetTrainSpeed_t GetTrainSpeed; + Player_IsPlayerUsingOmp_t IsPlayerUsingOmp; }; // Component functions @@ -2488,6 +2490,7 @@ static void omp_initialize_capi(struct OMPAPI_t* ompapi) { ompapi->Player.GetLandingGearState = (Player_GetLandingGearState_t)LIBRARY_GET_ADDR(capi_lib, "Player_GetLandingGearState"); ompapi->Player.GetHydraReactorAngle = (Player_GetHydraReactorAngle_t)LIBRARY_GET_ADDR(capi_lib, "Player_GetHydraReactorAngle"); ompapi->Player.GetTrainSpeed = (Player_GetTrainSpeed_t)LIBRARY_GET_ADDR(capi_lib, "Player_GetTrainSpeed"); + ompapi->Player.IsPlayerUsingOmp = (Player_IsPlayerUsingOmp_t)LIBRARY_GET_ADDR(capi_lib, "Player_IsPlayerUsingOmp"); // Retrieve Component functions ompapi->Component.Create = (Component_Create_t)LIBRARY_GET_ADDR(capi_lib, "Component_Create"); diff --git a/src/Impl/Players/APIs.cpp b/src/Impl/Players/APIs.cpp index 22e184f..48e8251 100644 --- a/src/Impl/Players/APIs.cpp +++ b/src/Impl/Players/APIs.cpp @@ -1415,3 +1415,10 @@ OMP_CAPI(Player_IsCuffed, bool(objectPtr player)) } return cuffed; } + +OMP_CAPI(Player_IsPlayerUsingOmp, bool(objectPtr player)) +{ + POOL_ENTITY_RET(players, IPlayer, player, player_, false); + bool ret = bool(player_->isUsingOmp()); + return ret; +} From 23c9b363efbe90443dce6252e1638ff7a97aae6b Mon Sep 17 00:00:00 2001 From: astro <15655250+0xFFFFFFFFFFFFFFFFFF@users.noreply.github.com> Date: Wed, 18 Jun 2025 17:25:23 +0200 Subject: [PATCH 2/2] Use Windows 2022 runner images see https://github.com/actions/runner-images/issues/12045 --- .github/workflows/build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3a169da..0323d36 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,7 +13,7 @@ on: jobs: build-windows-x64-release: - runs-on: windows-2019 + runs-on: windows-2022 steps: - uses: actions/checkout@v4 with: @@ -25,7 +25,7 @@ jobs: run: | mkdir build cd build - cmake -DCMAKE_BUILD_TYPE=Release .. -G "Visual Studio 16 2019" + cmake -DCMAKE_BUILD_TYPE=Release .. -G "Visual Studio 17 2022" cmake --build . --config Release - name: Create a folder for release @@ -41,7 +41,7 @@ jobs: path: dist/* build-windows-x86-release: - runs-on: windows-2019 + runs-on: windows-2022 steps: - uses: actions/checkout@v4 with: @@ -53,7 +53,7 @@ jobs: run: | mkdir build cd build - cmake -DCMAKE_BUILD_TYPE=Release .. -A Win32 -G "Visual Studio 16 2019" + cmake -DCMAKE_BUILD_TYPE=Release .. -A Win32 -G "Visual Studio 17 2022" cmake --build . --config Release - name: Create a folder for release