Skip to content
This repository was archived by the owner on Oct 8, 2025. It is now read-only.

Commit 425f5fd

Browse files
authored
Merge pull request #10 from 0xFFFFFFFFFFFFFFFFFF/master
Expose IsPlayerUsingOmp
2 parents 576721c + 23c9b36 commit 425f5fd

File tree

4 files changed

+24
-4
lines changed

4 files changed

+24
-4
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ on:
1313

1414
jobs:
1515
build-windows-x64-release:
16-
runs-on: windows-2019
16+
runs-on: windows-2022
1717
steps:
1818
- uses: actions/checkout@v4
1919
with:
@@ -25,7 +25,7 @@ jobs:
2525
run: |
2626
mkdir build
2727
cd build
28-
cmake -DCMAKE_BUILD_TYPE=Release .. -G "Visual Studio 16 2019"
28+
cmake -DCMAKE_BUILD_TYPE=Release .. -G "Visual Studio 17 2022"
2929
cmake --build . --config Release
3030
3131
- name: Create a folder for release
@@ -41,7 +41,7 @@ jobs:
4141
path: dist/*
4242

4343
build-windows-x86-release:
44-
runs-on: windows-2019
44+
runs-on: windows-2022
4545
steps:
4646
- uses: actions/checkout@v4
4747
with:
@@ -53,7 +53,7 @@ jobs:
5353
run: |
5454
mkdir build
5555
cd build
56-
cmake -DCMAKE_BUILD_TYPE=Release .. -A Win32 -G "Visual Studio 16 2019"
56+
cmake -DCMAKE_BUILD_TYPE=Release .. -A Win32 -G "Visual Studio 17 2022"
5757
cmake --build . --config Release
5858
5959
- name: Create a folder for release

apidocs/api.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3744,6 +3744,16 @@
37443744
"type": "void*"
37453745
}
37463746
]
3747+
},
3748+
{
3749+
"ret": "bool",
3750+
"name": "Player_IsPlayerUsingOmp",
3751+
"params": [
3752+
{
3753+
"name": "player",
3754+
"type": "void*"
3755+
}
3756+
]
37473757
}
37483758
],
37493759
"Component": [

include/ompcapi.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,7 @@ typedef int (*Player_GetSirenState_t)(void* player);
317317
typedef int (*Player_GetLandingGearState_t)(void* player);
318318
typedef uint32_t (*Player_GetHydraReactorAngle_t)(void* player);
319319
typedef float (*Player_GetTrainSpeed_t)(void* player);
320+
typedef bool (*Player_IsPlayerUsingOmp_t)(void* player);
320321

321322

322323
// Component function type definitions
@@ -1743,6 +1744,7 @@ struct Player_t {
17431744
Player_GetLandingGearState_t GetLandingGearState;
17441745
Player_GetHydraReactorAngle_t GetHydraReactorAngle;
17451746
Player_GetTrainSpeed_t GetTrainSpeed;
1747+
Player_IsPlayerUsingOmp_t IsPlayerUsingOmp;
17461748
};
17471749

17481750
// Component functions
@@ -2488,6 +2490,7 @@ static void omp_initialize_capi(struct OMPAPI_t* ompapi) {
24882490
ompapi->Player.GetLandingGearState = (Player_GetLandingGearState_t)LIBRARY_GET_ADDR(capi_lib, "Player_GetLandingGearState");
24892491
ompapi->Player.GetHydraReactorAngle = (Player_GetHydraReactorAngle_t)LIBRARY_GET_ADDR(capi_lib, "Player_GetHydraReactorAngle");
24902492
ompapi->Player.GetTrainSpeed = (Player_GetTrainSpeed_t)LIBRARY_GET_ADDR(capi_lib, "Player_GetTrainSpeed");
2493+
ompapi->Player.IsPlayerUsingOmp = (Player_IsPlayerUsingOmp_t)LIBRARY_GET_ADDR(capi_lib, "Player_IsPlayerUsingOmp");
24912494

24922495
// Retrieve Component functions
24932496
ompapi->Component.Create = (Component_Create_t)LIBRARY_GET_ADDR(capi_lib, "Component_Create");

src/Impl/Players/APIs.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1415,3 +1415,10 @@ OMP_CAPI(Player_IsCuffed, bool(objectPtr player))
14151415
}
14161416
return cuffed;
14171417
}
1418+
1419+
OMP_CAPI(Player_IsPlayerUsingOmp, bool(objectPtr player))
1420+
{
1421+
POOL_ENTITY_RET(players, IPlayer, player, player_, false);
1422+
bool ret = bool(player_->isUsingOmp());
1423+
return ret;
1424+
}

0 commit comments

Comments
 (0)