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 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; +}