From 953fb764a0884a4e6e0ecf519ea8a719d422455d Mon Sep 17 00:00:00 2001 From: ben Date: Sat, 17 Jan 2026 19:01:34 -0600 Subject: [PATCH 1/2] fill null pointer deref in voice label creation + added openbsd support --- CMakeLists.txt | 2 +- cl_dll/input/input_xash3d.cpp | 2 +- common/interface.cpp | 7 +++++-- dlls/util.h | 2 ++ game_shared/voice_status_hud.cpp | 7 ++++--- 5 files changed, 13 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1251583a..466cabd6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -144,4 +144,4 @@ endif() set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY OFF) -include(CPack) \ No newline at end of file +include(CPack) diff --git a/cl_dll/input/input_xash3d.cpp b/cl_dll/input/input_xash3d.cpp index 036da3f9..e5a220a0 100644 --- a/cl_dll/input/input_xash3d.cpp +++ b/cl_dll/input/input_xash3d.cpp @@ -186,7 +186,7 @@ void IN_Move( float frametime, usercmd_t *cmd ) viewangles[YAW] += rel_yaw; if( bLadder ) { - if( ( cl_laddermode->value == 1 ) ) + if( cl_laddermode->value == 1 ) viewangles[YAW] -= ac_sidemove * 5; ac_sidemove = 0; } diff --git a/common/interface.cpp b/common/interface.cpp index a13a9fd3..6d3de509 100644 --- a/common/interface.cpp +++ b/common/interface.cpp @@ -13,10 +13,13 @@ #if XASH_PSVITA == 1 #include #define VRTLD_LIBDL_COMPAT -#include +#include #elif XASH_APPLE == 1 #include #include +#elif XASH_OPENBSD == 1 +#include +#include #endif #if !defined( _WIN32 ) @@ -273,4 +276,4 @@ CreateInterfaceFn Sys_GetFactory( const char *pModuleName ) // so lets use the old style cast. return (CreateInterfaceFn)( Sys_GetProcAddress( pModuleName, CREATEINTERFACE_PROCNAME ) ); #endif -} \ No newline at end of file +} diff --git a/dlls/util.h b/dlls/util.h index 518300b2..270fd48b 100644 --- a/dlls/util.h +++ b/dlls/util.h @@ -65,7 +65,9 @@ inline edict_t *FIND_ENTITY_BY_TARGET(edict_t *entStart, const char *pszName) typedef int EOFFSET; typedef int BOOL; +#ifndef M_PI #define M_PI 3.14159265358979323846 +#endif #define DECLARE_GLOBAL_METHOD(MethodName) extern void DLLEXPORT MethodName(void) #define GLOBAL_METHOD(funcname) void DLLEXPORT funcname(void) diff --git a/game_shared/voice_status_hud.cpp b/game_shared/voice_status_hud.cpp index 97c1cd59..8f3690a2 100644 --- a/game_shared/voice_status_hud.cpp +++ b/game_shared/voice_status_hud.cpp @@ -186,7 +186,7 @@ CVoiceStatusHud::~CVoiceStatusHud() int CVoiceStatusHud::Init( IVoiceStatusHelper *pHelper, IVoiceStatus *pStatus ) { - m_VoiceHeadModel = NULL; + m_VoiceHeadModel = 0; m_pHelper = pHelper; m_pStatus = pStatus; @@ -385,7 +385,8 @@ void CVoiceStatusHud::UpdateSpeakerStatus( int entindex, bool bTalking ) // If we don't have a label for this guy yet, then create one. if ( !pLabel ) { - if ( pLabel = GetFreeVoiceLabel() ) + pLabel = GetFreeVoiceLabel(); + if ( pLabel ) { // Get the name from the engine. hud_player_info_t info; @@ -455,4 +456,4 @@ int CVoiceStatusHud::Draw( float flTime ) m_Labels[i]->Draw(); return 1; -} \ No newline at end of file +} From c12cb11c652fb1874f52ff57ef294f02809a6caa Mon Sep 17 00:00:00 2001 From: BaSeD_S1gmaToeSniffer69420 <218179008+S1gmaToeSniffer420@users.noreply.github.com> Date: Sat, 17 Jan 2026 21:30:31 -0600 Subject: [PATCH 2/2] Update README.md added custom readme --- README.md | 97 +++++++++++++------------------------------------------ 1 file changed, 22 insertions(+), 75 deletions(-) diff --git a/README.md b/README.md index 8d2febbf..596f45bc 100644 --- a/README.md +++ b/README.md @@ -1,82 +1,29 @@ -# CS16Client [![Build Status](https://github.com/Velaron/cs16-client/actions/workflows/build.yml/badge.svg)](https://github.com/Velaron/cs16-client/actions) CS16Client -Reverse-engineered Counter Strike 1.6 client, designed for mobile platforms and other officially non-supported platforms. +# CS16Client-OpenBSD -## Donate -[![Boosty.to](https://img.shields.io/badge/Boosty-F15F2C?logo=boosty&logoColor=fff&style=for-the-badge)](https://boosty.to/velaron) +https://github.com/Velaron/cs16-client +"ported" to OpenBSD. -[Support me](https://boosty.to/velaron) on Boosty.to, if you like my work and would like to support further development goals, like reverse-engineering other great mods. +# Building & Installing -Important contributors: -* [a1batross](https://github.com/a1batross), initial project creator and maintainer. -* [jeefo](https://github.com/jeefo), the creator of [YaPB](https://github.com/yapb/yapb). -* The people behind [ReGameDLL_CS](https://github.com/rehlds/ReGameDLL_CS) project. -* [Vladislav4KZ](https://github.com/Vladislav4KZ), bug-tester and maintainer. -* [SNMetamorph](https://github.com/SNMetamorph), author of the PSVita port. -* [Alprnn357](https://github.com/Alprnn357), touch menus maintainer. -* [wh1tesh1t](https://github.com/wh1tesh1t), [pwd491](https://github.com/pwd491), [Elinsrc](https://github.com/Elinsrc), [xiaodo1337](https://github.com/xiaodo1337), [nekonomicon](https://github.com/nekonomicon), [lewa-j](https://github.com/lewa-j) and others for minor contributions. - -## Download -You can download a build at the `Releases` section, or use these links for common platforms: -* [Android](https://github.com/Velaron/cs16-client/releases/download/continuous/CS16Client-Android.apk) -* [Linux](https://github.com/Velaron/cs16-client/releases/download/continuous/CS16Client-Linux-i386.tar.gz) -* [Windows](https://github.com/Velaron/cs16-client/releases/download/continuous/CS16Client-Windows-X86.zip) -* [PS Vita](https://github.com/Velaron/cs16-client/releases/download/continuous/CS16Client-PSVita.zip) -* [macOS (arm64)](https://github.com/Velaron/cs16-client/releases/download/continuous/CS16Client-macOS-arm64.zip) - not tested -* [macOS (x86_64)](https://github.com/Velaron/cs16-client/releases/download/continuous/CS16Client-macOS-x86_64.zip) - not tested - -[Other platforms...](https://github.com/Velaron/cs16-client/releases/tag/continuous) - -## Installation -To run CS16Client you need the [latest developer build of Xash3D FWGS](https://github.com/FWGS/xash3d-fwgs/releases/tag/continuous). -You have to own the [game on Steam](https://store.steampowered.com/app/10/CounterStrike//) and copy `valve` and `cstrike` folders into your Xash3D FWGS directory. -After that, just install the APK and run. +building is the same as the Linux build instructions of the https://github.com/Velaron/cs16-client +but here they are: +cmake -S . -B build +cmake --build build --config Release +cmake --install build --prefix -## Configuration (CVars) -| CVar | Default | Min | Max | Description | -|--------------------------|---------------|-----|-----|---------------------------------------------------------------------------------------------| -| hud_color | "255 160 0" | - | - | HUD color in RGB. | -| cl_quakeguns | 0 | 0 | 1 | Draw centered weapons. | -| cl_weaponlag | 0 | 0.0 | - | Enable weapon lag/sway. | -| xhair_additive | 0 | 0 | 1 | Makes the crosshair additive. | -| xhair_color | "0 255 0 255" | - | - | Crosshair's color (RGBA). | -| xhair_dot | 0 | 0 | 1 | Enables crosshair dot. | -| xhair_dynamic_move | 1 | 0 | 1 | Jumping, crouching and moving will affect the dynamic crosshair (like cl_dynamiccrosshair). | -| xhair_dynamic_scale | 0 | 0 | - | Scale of the dynamic crosshair movement. | -| xhair_gap_useweaponvalue | 0 | 0 | 1 | Makes the crosshair gap scale depend on the active weapon. | -| xhair_enable | 0 | 0 | 1 | Enables enhanced crosshair. | -| xhair_gap | 0 | 0 | 15 | Space between crosshair's lines. | -| xhair_pad | 0 | 0 | - | Border around crosshair. | -| xhair_size | 4 | 0 | - | Crosshair size. | -| xhair_t | 0 | 0 | 1 | Enables T-shaped crosshair. | -| xhair_thick | 0 | 0 | - | Crosshair thickness. | +# Status -## Building -Clone the source code: -```shell -git clone https://github.com/Velaron/cs16-client --recursive -``` +- Tested on OpenBSD version 7.8 +- Using AMD64 architecture +- Many multiplayer servers do not work due to steam requirements +- Takes a long time to download resources from some servers, and some simply do not work because of steam auth +- Training mode works (needs more testing) +- Bots not tested yet +- No known issues yet -### Using CMakePresets.json -```shell -cmake --preset -cmake --build build -cmake --install build --prefix -``` +# TODO +- test bots +- maybe try to get added to ports tree -### Windows -```shell -cmake -A Win32 -S . -B build -cmake --build build --config Release -cmake --install build --prefix -``` -### Linux and macOS -```shell -cmake -S . -B build -cmake --build build --config Release -cmake --install build --prefix -``` -### Android -```shell -cd android -./gradlew assembleRelease -``` +# Credits +original project: https://github.com/Velaron/cs16-client