diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 93bd63f3b..cc4d8a8f8 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: recursive @@ -46,7 +46,7 @@ jobs: run: cmake --install ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} - name: Upload artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: Linux-x86 path: ${{env.GAME_NAME}} @@ -56,7 +56,7 @@ jobs: runs-on: windows-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: recursive @@ -81,7 +81,7 @@ jobs: run: cmake --install ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} - name: Upload artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: Win32 path: ${{env.GAME_NAME}} diff --git a/BUILDING.md b/BUILDING.md index eb862b347..a90ecd697 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -1,13 +1,13 @@ # Building this SDK -This tutorial expects a strong grasp of the basics of command line interfaces, version control, build systems (CMake, Visual Studio, Makefiles) and C++. +This tutorial expects a strong grasp of of C++, build systems like Visual Studio or Make (depending on the platform you're developing for), CMake, command line interfaces, version control systems (Git in particular) and package managers (vcpkg in particular). All instructions for Linux development are written to apply to Ubuntu. Substitute commands and actions as needed for your distribution. It is expected that you understand how to work with the Linux terminal and command line. ## Minimum requirements The minimum requirements for this project are: -* [CMake 3.23 or newer](https://cmake.org/download/) +* [CMake 3.23 or newer](https://cmake.org/download/) (**Note**: avoid versions 3.28 and 3.28.1 as they fail to download vcpkg dependencies. See [this](https://github.com/microsoft/vcpkg/issues/33904) issue for more information) ### For Windows development @@ -21,7 +21,7 @@ The minimum requirements for this project are: * C++ profiling tools * Windows 10 SDK (select the latest version) -Note: vcpkg uses the latest version of Visual Studio installed on your system to compile dependencies. Using an older version of Visual Studio to compile the SDK itself may cause compiler errors. +> **Note**: vcpkg uses the latest version of Visual Studio installed on your system to compile dependencies. Using an older version of Visual Studio to compile the SDK itself may cause compiler errors. Always use the latest installed version of Visual Studio to build the SDK. ### For Linux development @@ -39,13 +39,13 @@ Clone the repository. Since it uses submodules you will need to make sure they a The following git command will clone the repository with submodules into the directory `/halflife-unified-sdk`: ```sh cd path/to/where/you/want/source/code -git clone --recurse-submodules https://github.com/SamVanheer/halflife-unified-sdk.git +git clone --recurse-submodules https://github.com/twhl-community/halflife-unified-sdk.git ``` It is recommended to put the source code directory in a directory of its own: ```sh cd path/to/directory/halflife-unified-sdk_dev -git clone --recurse-submodules https://github.com/SamVanheer/halflife-unified-sdk.git +git clone --recurse-submodules https://github.com/twhl-community/halflife-unified-sdk.git ``` This makes it easier to group related directories and files together. diff --git a/CMakeLists.txt b/CMakeLists.txt index f9c871338..db568c6cc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -110,8 +110,11 @@ function(set_common_properties TARGET_NAME) $<$:-fpermissive -fno-strict-aliasing -Wno-invalid-offsetof -march=pentium-m -mfpmath=387> # flifetime-dse=1 is needed to disable a compiler optimization that optimizes out std::memset calls in CBaseEntity::operator new - # See https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html#index-flifetime-dse for more information about the flifetime-dse flag - $<$:-flifetime-dse=1> + # See https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html#index-flifetime-dse for more information about this flag + # fno-gnu-unique is needed to disable a compiler optimization that prevents dlclose from unloading mod dlls, + # causing them to retain state and crash when the engine tries to access memory in an invalid way + # See https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#index-fno-gnu-unique for more information about this flag + $<$:-flifetime-dse=1 -fno-gnu-unique> # Can't set warning level to W4 until the compiler can deal with std::visit containing static_assert, which currently causes false positive "Unreachable code" warnings $<$:/W3 /MP> diff --git a/DEVELOPING.md b/DEVELOPING.md index cdcc22476..6a3b764cc 100644 --- a/DEVELOPING.md +++ b/DEVELOPING.md @@ -1,21 +1,30 @@ -# **Note**: The Unified SDK is still in development and not ready for use beyond alpha testing and feedback. - # Developing with the Unified SDK ## Prerequisite knowledge -You will need a working knowledge of command line interfaces, CMake and C++ to make a mod with this SDK. +You will need a strong grasp of of C++, build systems like Visual Studio or Make (depending on the platform you're developing for), CMake, command line interfaces, version control systems (Git in particular) and package managers (vcpkg in particular). Various configuration files use JSON so an understanding of its syntax is recommended. Tools and scripts are written in C# so you will need to have an understanding of its syntax to modify them. +This project uses vcpkg in manifest mode to acquire most third party dependencies, with the exception of dependencies shipped with the game itself (vgui1 and SDL2). You should use vcpkg to add any dependencies you need. If a dependency is not provided by vcpkg's own registry you can add it to the local filesystem registry in `vcpkg-configuration.json`. + +Note that the OpenAL library is a custom build that renames the dynamic library name to avoid conflicting with the engine's use of OpenAL on Linux. If you update OpenAL you must also update the patch used to rename the library. + +Also note that Github Actions performs a shallow clone of the vcpkg repository. When updating vcpkg make sure all dependencies are using the latest version, otherwise Github Actions will fail to locate the package information. + +You can use the local registry to reference an older version by copying the older version package definition from the vcpkg registry to the local registry, but do make note of transitive dependencies to avoid using multiple conflicting versions of the same package (e.g. `spdlog` references `fmtlib` which this project also directly references). + +Consult the vcpkg documentation before changing anything to ensure you understand how it works and how your changes will affect the project. + Resources to learn these things: * [Command line](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/windows-commands) * [CMake](https://cliutils.gitlab.io/modern-cmake/) * [C++](https://www.learncpp.com/) * [C#](https://learn.microsoft.com/en-us/dotnet/csharp/) * [JSON](https://www.w3schools.com/js/js_json_syntax.asp) +* [vcpkg](https://vcpkg.io/en/getting-started) > **Make sure to learn these things first so you understand how this SDK works!** @@ -70,3 +79,9 @@ Original maps can't be redistributed, and changes made to SDK code require chang The [MapUpgrader](docs/tools/map-upgrader.md) tool is a standalone version of the installer's map upgrade functionality. It can be used to upgrade a map to the Unified SDK, provided that the map was made for the original version of Half-Life and not another mod or game. Most modders won't need to use these tools, but they are there to streamline the development process as much as possible. + +### Special note about Half-Life Uplink maps + +The Half-Life Uplink demo isn't available on Steam so the maps are included with the Unified SDK's mod installation. + +When packaging the installation the packager looks in the mod directory named `valve_uplink` for the Uplink maps. You will need to take the Uplink maps and place them in `valve_uplink/maps` for this to work. diff --git a/FULL_UPDATED_CHANGELOG.md b/FULL_UPDATED_CHANGELOG.md index c16752d67..3f4728ed9 100644 --- a/FULL_UPDATED_CHANGELOG.md +++ b/FULL_UPDATED_CHANGELOG.md @@ -50,7 +50,7 @@ Fixes for bugs introduced in beta builds are not included in this list. * Implemented cl_autowepswitch cvar (halflife issues [#169](https://github.com/ValveSoftware/halflife/issues/169) and [#2749](https://github.com/ValveSoftware/halflife/issues/2749)) * Fixed server not staying in sync with client when handling weapon attack times (halflife issue [#1621](https://github.com/ValveSoftware/halflife/issues/1621)) * Use MAX_WEAPONS for array of weapons (halflife issue [#3030](https://github.com/ValveSoftware/halflife/issues/3030)) -* Added support for adding 64 weapons [#98](https://github.com/SamVanheer/halflife-updated/issues/98) +* Added support for adding 64 weapons [#98](https://github.com/twhl-community/halflife-updated/issues/98) * Fixed not being able to reload weapons after loading a save game (halflife issue [#1707](https://github.com/ValveSoftware/halflife/issues/1707)) * Always return m_iSecondaryAmmoType from CBasePlayerWeapon::SecondaryAmmoIndex (halflife issue [#3029](https://github.com/ValveSoftware/halflife/issues/3029)) * Fixed weapon prediction allowing multiple reload actions instead of just one (halflife issue [#2301](https://github.com/ValveSoftware/halflife/issues/2301)) @@ -63,26 +63,27 @@ Fixes for bugs introduced in beta builds are not included in this list. * Ensured PrimaryAmmoIndex & SecondaryAmmoIndex return valid values (halflife issue [#3073](https://github.com/ValveSoftware/halflife/issues/3073)) * Initialize ItemInfoArray & AmmoInfoArray on the client (halflife issue [#3071](https://github.com/ValveSoftware/halflife/issues/3071)) * Use cached item info for client predicted reloads -* Added missing tracerCount for EV_HLDM_FireBullets [#107](https://github.com/SamVanheer/halflife-updated/pull/107) (Thanks malortie) -* Reserved enough entvars for all weapons + local player in client weapon prediction code [#97](https://github.com/SamVanheer/halflife-updated/issues/97) +* Added missing tracerCount for EV_HLDM_FireBullets [#107](https://github.com/twhl-community/halflife-updated/pull/107) (Thanks malortie) +* Reserved enough entvars for all weapons + local player in client weapon prediction code [#97](https://github.com/twhl-community/halflife-updated/issues/97) * Applied Opposing Force weapon prediction timing fix to Half-Life (halflife issue [#3252](https://github.com/ValveSoftware/halflife/issues/3252)) -* Automatically switch away from exhaustible weapons that have no ammo left [#133](https://github.com/SamVanheer/halflife-updated/issues/133) -* Fixed controlling a func_tank with empty weapon deploying invisible weapon when stopping control [#134](https://github.com/SamVanheer/halflife-updated/issues/134) +* Automatically switch away from exhaustible weapons that have no ammo left [#133](https://github.com/twhl-community/halflife-updated/issues/133) +* Fixed controlling a func_tank with empty weapon deploying invisible weapon when stopping control [#134](https://github.com/twhl-community/halflife-updated/issues/134) * Fixed weapon empty sound playing twice (halflife issue [#3231](https://github.com/ValveSoftware/halflife/issues/3231)) * Fixed explosions going through walls in certain cases (halflife issue [#3244](https://github.com/ValveSoftware/halflife/issues/3244)) * Allow weapons to network data as needed * Initialize frametime value so weapon prediction code can use it * Reset server's client FOV value so loading save games restores FOV correctly with weapon prediction disabled (halflife issue [#3044](https://github.com/ValveSoftware/halflife/issues/3044)) -* Fixed players not being given exhaustible weapons when they get the ammo for them [#153](https://github.com/SamVanheer/halflife-updated/issues/153) -* Fixed weapon deploy animations caused by lastinv command not working properly [#154](https://github.com/SamVanheer/halflife-updated/issues/154) -* Fixed weapon deploy animations on fast switching with user binds [#161](https://github.com/SamVanheer/halflife-updated/pull/161) -* Cleaned up weapons code a bit [#157](https://github.com/SamVanheer/halflife-updated/issues/157) -* Fixed incorrect body values being passed into EV_WeaponAnimation [#159](https://github.com/SamVanheer/halflife-updated/issues/159) -* Fixed autoswitch from tripmine to RPG causing wrong animation to play when weapon prediction is off [#160](https://github.com/SamVanheer/halflife-updated/issues/160) +* Fixed players not being given exhaustible weapons when they get the ammo for them [#153](https://github.com/twhl-community/halflife-updated/issues/153) +* Fixed weapon deploy animations caused by lastinv command not working properly [#154](https://github.com/twhl-community/halflife-updated/issues/154) +* Fixed weapon deploy animations on fast switching with user binds [#161](https://github.com/twhl-community/halflife-updated/pull/161) +* Cleaned up weapons code a bit [#157](https://github.com/twhl-community/halflife-updated/issues/157) +* Fixed incorrect body values being passed into EV_WeaponAnimation [#159](https://github.com/twhl-community/halflife-updated/issues/159) +* Fixed autoswitch from tripmine to RPG causing wrong animation to play when weapon prediction is off [#160](https://github.com/twhl-community/halflife-updated/issues/160) * Fixed explosives that impact the underside of a brush dealing damage to entities on the other side of that brush (halflife issue [#3244](https://github.com/ValveSoftware/halflife/issues/3244)) * Fixed player weapons still receiving input when starting to use a func_tank (halflife issue [#3345](https://github.com/ValveSoftware/halflife/issues/3345)) (Thanks Oxofemple.) * Fixed limit in world weapons (e.g. Hand Grenade) respawning at wrong time if server is near edict limit * Disabled fall think function for weapons when the player picks it up to prevent possible double-pickup which removes the weapon and crashes the game +* Fixed weapon events not treating pushable objects as BSP models [#220](https://github.com/twhl-community/halflife-updated/pull/220) (Thanks Toodles2You) ### Crowbar @@ -91,10 +92,11 @@ Fixes for bugs introduced in beta builds are not included in this list. * Fixed crowbar not showing in weapon list if there are empty weapon slots with a lower id (halflife [#3181](https://github.com/ValveSoftware/halflife/issues/3181)) * Fixed the Crowbar damage always being calculated halved (halflife issue [#1600](https://github.com/ValveSoftware/halflife/pull/1600)) (Thanks YaLTeR) * Fixed Crowbar playing back swing events twice sometimes (halflife issue [#3230](https://github.com/ValveSoftware/halflife/issues/3230)) +* Fixed crowbar applying breakable glass decals to unbreakable pushable objects [#219](https://github.com/twhl-community/halflife-updated/pull/219) (Thanks Toodles2You) ### Glock -* Fixed Glock fire on empty sequence not playing [#70](https://github.com/SamVanheer/halflife-updated/pull/70) (Thanks malortie) +* Fixed Glock fire on empty sequence not playing [#70](https://github.com/twhl-community/halflife-updated/pull/70) (Thanks malortie) * Fixed Glock not playing empty sound when using secondary attack ### Python (357) @@ -106,26 +108,26 @@ Fixes for bugs introduced in beta builds are not included in this list. ### MP5 * Fixed MP5 using wrong spread values for multiplayer and singleplayer (halflife issue [#2095](https://github.com/ValveSoftware/halflife/issues/2095)) * Fixed MP5 autoswitching when primary ammo is depleted, even if player still has secondary ammo (halflife issue [#3001](https://github.com/ValveSoftware/halflife/issues/3001)) -* Fixed MP5 not creating bullet decals half the time (halflife issue [#383](https://github.com/ValveSoftware/halflife/issues/383) and Updated issue [#163](https://github.com/SamVanheer/halflife-updated/issues/163)) +* Fixed MP5 not creating bullet decals half the time (halflife issue [#383](https://github.com/ValveSoftware/halflife/issues/383) and Updated issue [#163](https://github.com/twhl-community/halflife-updated/issues/163)) ### Shotgun * Fixed Shotgun pump sound not playing when holding down attack or when shooting last shell (halflife issue [#617](https://github.com/ValveSoftware/halflife/issues/617)) -* Fixed Shotgun starting idle animations too quickly after exhausting all ammo using primary attack [#195](https://github.com/SamVanheer/halflife-updated/issues/195) (Thanks Ronin4862) +* Fixed Shotgun starting idle animations too quickly after exhausting all ammo using primary attack [#195](https://github.com/twhl-community/halflife-updated/issues/195) (Thanks Ronin4862) ### Crossbow -* Fixed Crossbow fire on empty sequence not playing [#68](https://github.com/SamVanheer/halflife-updated/pull/68) (Thanks malortie) +* Fixed Crossbow fire on empty sequence not playing [#68](https://github.com/twhl-community/halflife-updated/pull/68) (Thanks malortie) * Removed m_fInZoom from Crossbow to ensure zoom state restores correctly (halflife issue [#3045](https://github.com/ValveSoftware/halflife/issues/3045)) ### RPG -* Fixed RPG reload reading uninitialized variable [#42](https://github.com/SamVanheer/halflife-updated/issues/42) -* Fixed RPG client prediction results stored in wrong pointer [#67](https://github.com/SamVanheer/halflife-updated/pull/67) (Thanks malortie) +* Fixed RPG reload reading uninitialized variable [#42](https://github.com/twhl-community/halflife-updated/issues/42) +* Fixed RPG client prediction results stored in wrong pointer [#67](https://github.com/twhl-community/halflife-updated/pull/67) (Thanks malortie) * Fixed a bug that could cause a crash if an RPG weapon were removed from a player while a rocket fired from it is in flight (halflife issue [#1719](https://github.com/ValveSoftware/halflife/issues/1719)) * Fixed incorrect idle time values for RPG fidget animations (halflife issue [#2495](https://github.com/ValveSoftware/halflife/issues/2495)) * Fixed RPG empty sound playing constantly (halflife issue [#617](https://github.com/ValveSoftware/halflife/issues/617)) * Fixed RPG sometimes getting stuck unable to reload (halflife issue [#3264](https://github.com/ValveSoftware/halflife/issues/3264)) (Thanks Ronin4862) -* Fixed RPG being flagged as unusable while a rocket is loaded [#213](https://github.com/SamVanheer/halflife-updated/pull/213) (Thanks Toodles2You) +* Fixed RPG being flagged as unusable while a rocket is loaded [#213](https://github.com/twhl-community/halflife-updated/pull/213) (Thanks Toodles2You) * Fixed RPG laser turning on when reloading immediately after equipping the weapon ### Gauss gun @@ -149,13 +151,14 @@ Fixes for bugs introduced in beta builds are not included in this list. * Implemented skill cvars `sk_plr_hornet_dmg1/2/3` for player Hornet gun damage * Fixed chainsaw Hornet gun sounds and mostly fixed hornetgun not playing firing animation (halflife issue [#556](https://github.com/ValveSoftware/halflife/issues/556)) -* Fixed Hornet gun recharging to full ammo after loading a save game [#190](https://github.com/SamVanheer/halflife-updated/issues/190) +* Fixed Hornet gun recharging to full ammo after loading a save game [#190](https://github.com/twhl-community/halflife-updated/issues/190) ### Hand grenade * Fixed Hand grenade not playing deploy animation after finishing a throw (halflife issue [#2495](https://github.com/ValveSoftware/halflife/issues/2495)) * Fixed Hand grenades staying primed when switching away or dropping the weapon (halflife issue [#3251](https://github.com/ValveSoftware/halflife/issues/3251)) -* Fixed hand grenade animations not playing correctly [#209](https://github.com/SamVanheer/halflife-updated/pull/209) (Thanks Toodles2You) +* Fixed hand grenade animations not playing correctly [#209](https://github.com/twhl-community/halflife-updated/pull/209) (Thanks Toodles2You) +* Reset frame to 0 when grenade bounces [#238](https://github.com/twhl-community/halflife-updated/issues/238) (Thanks FreeSlave) ### Satchel charge @@ -163,10 +166,10 @@ Fixes for bugs introduced in beta builds are not included in this list. ### Tripmine -* Fixed Tripmine viewmodel having wrong body on first pickup when weapon prediction is enabled [#129](https://github.com/SamVanheer/halflife-updated/issues/129) +* Fixed Tripmine viewmodel having wrong body on first pickup when weapon prediction is enabled [#129](https://github.com/twhl-community/halflife-updated/issues/129) * Fixed Tripmine beams not using correctly start position sometimes (halflife issue [#1670](https://github.com/ValveSoftware/halflife/issues/1670)) (Thanks vasiavasiavasia95) * Fixed Tripmine laser beam duplicating after going back and forth through level changes (halflife issue [#3245](https://github.com/ValveSoftware/halflife/issues/3245)) (Thanks vasiavasiavasia95) -* Fixed Tripmine body value being influenced by events from other weapons during deploy [#158](https://github.com/SamVanheer/halflife-updated/issues/158) +* Fixed Tripmine body value being influenced by events from other weapons during deploy [#158](https://github.com/twhl-community/halflife-updated/issues/158) ### Snark grenade * Fixed incorrect idle time values for Snark grenade deploy animations (halflife issue [#2495](https://github.com/ValveSoftware/halflife/issues/2495)) @@ -180,10 +183,10 @@ Fixes for bugs introduced in beta builds are not included in this list. * Made IsFacing non-static so it can be used in other source files * Fixed incorrect check for monster gag spawnflag (halflife issue [#3076](https://github.com/ValveSoftware/halflife/issues/3076)) * Fixed CTalkMonster::RunTask not properly initializing variable (halflife issue [#3177](https://github.com/ValveSoftware/halflife/issues/3177)) -* Added keyvalue `allow_item_dropping` to control whether NPCs can drop items (Opposing Force Updated [#72](https://github.com/SamVanheer/halflife-op4-updated/issues/72)) -* Fixed NPCs being able to speak scripted_sentences while dying [#171](https://github.com/SamVanheer/halflife-updated/issues/171) +* Added keyvalue `allow_item_dropping` to control whether NPCs can drop items (Opposing Force Updated [#72](https://github.com/twhl-community/halflife-op4-updated/issues/72)) +* Fixed NPCs being able to speak scripted_sentences while dying [#171](https://github.com/twhl-community/halflife-updated/issues/171) * Added missing monster state name to ReportAIState (halflife issue [#3220](https://github.com/ValveSoftware/halflife/issues/3220)) (Thanks Shepard) -* Fixed being able to break scripted_sequence by +using friendly NPCs to make them follow player [#200](https://github.com/SamVanheer/halflife-updated/issues/200) (Thanks Oxofemple. for reporting this and FreeSlave for finding the solution) +* Fixed being able to break scripted_sequence by +using friendly NPCs to make them follow player [#200](https://github.com/twhl-community/halflife-updated/issues/200) (Thanks Oxofemple. for reporting this and FreeSlave for finding the solution) * Fixed potential incorrect facing in scripted sequence (Thanks FreeSlave) * Fixed crash when +USEing NPCs that have just exited a scripted sequence (Thanks malortie) * Fixed talk monsters resetting other talk monsters' dying schedule if they are both killed at the same time (Thanks FreeSlave) @@ -196,7 +199,7 @@ Fixes for bugs introduced in beta builds are not included in this list. * Fixed Gargantua stomp attack being framerate-dependent (halflife issue [#2876](https://github.com/ValveSoftware/halflife/issues/2876)) * Fixed Snark movetype being changed unconditionally (halflife issue [#3175](https://github.com/ValveSoftware/halflife/issues/3175)) * Fixed Human Grunt checking enemy incorrectly in CheckMeleeAttack1 (halflife issue [#3176](https://github.com/ValveSoftware/halflife/issues/3176)) -* Fixed Human Grunts continuing to fire for a few seconds after killing the last enemy in an area [Opposing Force Updated #100](https://github.com/SamVanheer/halflife-op4-updated/issues/100) (Thanks Ronin4862 and malortie) +* Fixed Human Grunts continuing to fire for a few seconds after killing the last enemy in an area [Opposing Force Updated #100](https://github.com/twhl-community/halflife-op4-updated/issues/100) (Thanks Ronin4862 and malortie) * Fixed Hornets crashing the game if they hit you after a level transition (halflife issue [#1598](https://github.com/ValveSoftware/halflife/pull/1598)) * Fixed Osprey not interpolating (halflife issue [#3228](https://github.com/ValveSoftware/halflife/issues/3228)) (Thanks Hezus) * Fixed Osprey crashing if it has no valid target (halflife issue [#3259](https://github.com/ValveSoftware/halflife/issues/3259)) @@ -205,9 +208,9 @@ Fixes for bugs introduced in beta builds are not included in this list. * Fixed Osprey engine damage effects showing on wrong engine (halflife issue [#3263](https://github.com/ValveSoftware/halflife/issues/3263)) (Thanks Hezus) * Fixed Apache not firing trigger targets (halflife issue [#3262](https://github.com/ValveSoftware/halflife/issues/3262)) * Fixed Tentacle not interpolating (halflife issue [#3228](https://github.com/ValveSoftware/halflife/issues/3228)) (Thanks Anton) -* Fixed Ichthyosaur restarting death sequence on save game load [#152](https://github.com/SamVanheer/halflife-updated/issues/152) -* Fixed Alien Controllers facing in non-combat state [#155](https://github.com/SamVanheer/halflife-updated/pull/155) -* Fixed scientist voice pitch [#156](https://github.com/SamVanheer/halflife-updated/pull/156) +* Fixed Ichthyosaur restarting death sequence on save game load [#152](https://github.com/twhl-community/halflife-updated/issues/152) +* Fixed Alien Controllers facing in non-combat state [#155](https://github.com/twhl-community/halflife-updated/pull/155) +* Fixed scientist voice pitch [#156](https://github.com/twhl-community/halflife-updated/pull/156) * Fixed Human Grunts dropping weapons again if the game is saved and loaded while the grunt is dying (Thanks Oxofemple.) * Fixed Scientists crashing when speaking fear dialogue when enemy has been removed @@ -231,7 +234,7 @@ Fixes for bugs introduced in beta builds are not included in this list. * Show pickup icons in HUD for all weapons (halflife issue [#3137](https://github.com/ValveSoftware/halflife/issues/3137)) * Fixed picking up weapons that give free/regenerating ammo sometimes showing weapon icon as red (halflife issue [#3250](https://github.com/ValveSoftware/halflife/issues/3250)) * Fixed crash while parsing command menu with unsupported custom button (halflife issue [#1730](https://github.com/ValveSoftware/halflife/issues/1730)) -* Reset current history icon slot when resetting item history HUD [#223](https://github.com/SamVanheer/halflife-updated/issues/223) (Thanks malortie) +* Reset current history icon slot when resetting item history HUD [#223](https://github.com/twhl-community/halflife-updated/issues/223) (Thanks malortie) ## Other @@ -263,38 +266,38 @@ Fixes for bugs introduced in beta builds are not included in this list. * Fixed func_breakable keyvalue "explosion" not working (#24) (Thanks ArroganceJustified) * Fixed memory leak in VGUI1 image loading code (halflife issue [#3101](https://github.com/ValveSoftware/halflife/issues/3101)) * Fixed underwater breathing sounds playing when standing in shallow water (halflife issue [#3110](https://github.com/ValveSoftware/halflife/issues/3110)) -* Fixed camera not being consistently centered when raw mouse input is enabled (Thanks IntriguingTiles) [#32](https://github.com/SamVanheer/halflife-updated/pull/32) -* Added new cvar flags added by recent engine updates [#46](https://github.com/SamVanheer/halflife-updated/issues/46) -* Added new cvar flags for command filtering [#121](https://github.com/SamVanheer/halflife-updated/issues/121) (Thanks a1batross and vasiavasiavasia95) -* Provided access to engine filesystem [#86](https://github.com/SamVanheer/halflife-updated/issues/86) -* Use engine filesystem to load and save node graph files [#87](https://github.com/SamVanheer/halflife-updated/issues/87) -* Define and use constants for maximum number of players and weapons [#96](https://github.com/SamVanheer/halflife-updated/issues/96) -* Added support for saving and restoring 64 bit integers [#99](https://github.com/SamVanheer/halflife-updated/issues/99) -* Fixed cycler_sprite not saving [#43](https://github.com/SamVanheer/halflife-updated/issues/43) -* Fixed func_rotating not reporting keyvalue spawnorigin as handled [#72](https://github.com/SamVanheer/halflife-updated/issues/72) -* Fixed infodecal not reporting keyvalue texture as handled [#73](https://github.com/SamVanheer/halflife-updated/issues/73) -* Fixed beam attachment invalidated on restore [#74](https://github.com/SamVanheer/halflife-updated/pull/74) (Thanks malortie) +* Fixed camera not being consistently centered when raw mouse input is enabled [#32](https://github.com/twhl-community/halflife-updated/pull/32) (Thanks IntriguingTiles) +* Added new cvar flags added by recent engine updates [#46](https://github.com/twhl-community/halflife-updated/issues/46) +* Added new cvar flags for command filtering [#121](https://github.com/twhl-community/halflife-updated/issues/121) (Thanks a1batross and vasiavasiavasia95) +* Provided access to engine filesystem [#86](https://github.com/twhl-community/halflife-updated/issues/86) +* Use engine filesystem to load and save node graph files [#87](https://github.com/twhl-community/halflife-updated/issues/87) +* Define and use constants for maximum number of players and weapons [#96](https://github.com/twhl-community/halflife-updated/issues/96) +* Added support for saving and restoring 64 bit integers [#99](https://github.com/twhl-community/halflife-updated/issues/99) +* Fixed cycler_sprite not saving [#43](https://github.com/twhl-community/halflife-updated/issues/43) +* Fixed func_rotating not reporting keyvalue spawnorigin as handled [#72](https://github.com/twhl-community/halflife-updated/issues/72) +* Fixed infodecal not reporting keyvalue texture as handled [#73](https://github.com/twhl-community/halflife-updated/issues/73) +* Fixed beam attachment invalidated on restore [#74](https://github.com/twhl-community/halflife-updated/pull/74) (Thanks malortie) * Fixed speaker entity not handling invalid preset values correctly (halflife issue [#3178](https://github.com/ValveSoftware/halflife/issues/3178)) -* Fixed invalidated linked entities in node graph [#106](https://github.com/SamVanheer/halflife-updated/pull/106) (Thanks zaklaus) -* Fixed default implementation of HasTarget not checking the right variable [#109](https://github.com/SamVanheer/halflife-updated/pull/109) (Thanks malortie) -* Implemented particle manager in client library [#122](https://github.com/SamVanheer/halflife-updated/issues/122) +* Fixed invalidated linked entities in node graph [#106](https://github.com/twhl-community/halflife-updated/pull/106) (Thanks zaklaus) +* Fixed default implementation of HasTarget not checking the right variable [#109](https://github.com/twhl-community/halflife-updated/pull/109) (Thanks malortie) +* Implemented particle manager in client library [#122](https://github.com/twhl-community/halflife-updated/issues/122) * This change fixes halflife issue [#2196](https://github.com/ValveSoftware/halflife/issues/2196) by embedding the particle manager in the client library. It also fixes compatibility issues caused by optimizations applied to the Vector type. * Reworked particle memory management to allow far more particles to be allocated before crashing by running out of memory (previous limit was around 100 particles at the same time, new limit closer to 1 million). Fixes halflife [#1447](https://github.com/ValveSoftware/halflife/issues/1447) * Fixed memory leak in the physics force list: halflife [#3213](https://github.com/ValveSoftware/halflife/issues/3213) * Fixed use-after-free bug that could cause difficult to debug problems in (hopefully) theoretical cases: [#3214](https://github.com/ValveSoftware/halflife/issues/3214) * Optimized some of the code to be more efficient * Reworked the CBaseParticle class to use a simpler design -* Fixed V_CalcBob not initializing static variables [#126](https://github.com/SamVanheer/halflife-updated/issues/126) +* Fixed V_CalcBob not initializing static variables [#126](https://github.com/twhl-community/halflife-updated/issues/126) * Fixed models stuttering due to client side interpolation (halflife issue [#3228](https://github.com/ValveSoftware/halflife/issues/3228)) (Thanks Uncle Mike, and vasiavasiavasia95 and Bacontsu for bringing this fix to my attention) * Fixed player physics hull sizes not initializing properly (halflife issue [#3229](https://github.com/ValveSoftware/halflife/issues/3229)) (Thanks vasiavasiavasia95) * Fixed FL_FAKECLIENT flag being cleared in some places (halflife issue [#3256](https://github.com/ValveSoftware/halflife/issues/3256)) -* Fixed Error in ServerCtrl [#135](https://github.com/SamVanheer/halflife-updated/pull/135) (Thanks fel1x-developer) +* Fixed Error in ServerCtrl [#135](https://github.com/twhl-community/halflife-updated/pull/135) (Thanks fel1x-developer) * Pass director stufftext commands to filtered client command function (halflife issue [#1497](https://github.com/ValveSoftware/halflife/issues/1497)) -* Fixed node graphs being loaded from search paths other than GAMECONFIG path [#145](https://github.com/SamVanheer/halflife-updated/issues/145) +* Fixed node graphs being loaded from search paths other than GAMECONFIG path [#145](https://github.com/twhl-community/halflife-updated/issues/145) * Fixed node graph code incorrectly flagging node graphs as out of date if an outdated graph exists in a search path other than the mod directory (e.g. a graph in `halflife_updated_addon/map/graphs`) * Fixed momentary_door restarting movement sound repeatedly when moving back to starting position (halflife issue [#3265](https://github.com/ValveSoftware/halflife/issues/3265)) -* Fixed "fullupdate" call making a HUD disappear [#147](https://github.com/SamVanheer/halflife-updated/issues/147) -* Fixed STL Algorithm Header Errors When Included with Platform.h [#148](https://github.com/SamVanheer/halflife-updated/pull/148) (Thanks edgarbarney) +* Fixed "fullupdate" call making a HUD disappear [#147](https://github.com/twhl-community/halflife-updated/issues/147) +* Fixed STL Algorithm Header Errors When Included with Platform.h [#148](https://github.com/twhl-community/halflife-updated/pull/148) (Thanks edgarbarney) * Fixed func_button "Sparks" spawnflag using wrong origin (halflife issue [#3269](https://github.com/ValveSoftware/halflife/issues/3269)) * Fixed func_rot_button "X Axis" spawnflag also enabling func_button "Sparks" behavior (halflife issue [#3270](https://github.com/ValveSoftware/halflife/issues/3270)) * Fixed second case of incorrect timebase for button sparks (halflife issue [#1681](https://github.com/ValveSoftware/halflife/issues/1681)) @@ -302,26 +305,26 @@ Fixes for bugs introduced in beta builds are not included in this list. * Fixed ServerActivate checking for player entities incorrectly (halflife [#3282](https://github.com/ValveSoftware/halflife/issues/3282)) * Fixed PM_TraceModel possibly returning uninitialized trace (halflife [#3283](https://github.com/ValveSoftware/halflife/issues/3283)) * Print error message if trigger_changelevel points to itself -* Updated smdlexp to use 3DS Max 2023 SDK [#149](https://github.com/SamVanheer/halflife-updated/pull/149) +* Updated smdlexp to use 3DS Max 2023 SDK [#149](https://github.com/twhl-community/halflife-updated/pull/149) * Updated to fix configuration issues so both debug and release profiles compile and don't fail when trying to copy the library to the 3DS Max plugins directory * Added errors to stop compilation if the library is not built as 64 bit or if it does not use the Unicode character set (required for 3DS Max 2023 plugins) * Note: plugin has not been tested. Use this plugin instead: [https://knockout.chat/thread/806/1](https://knockout.chat/thread/806/1) * Refactored env_sound code to use correct data type for room type, don't use goto to control think rate * Always send room_type changes to client, set room_type to 0 by default, reset room_type to 0 on map change, save room_type and restore it when loading same map (halflife issues [#1144](https://github.com/ValveSoftware/halflife/issues/1144) and [#2936](https://github.com/ValveSoftware/halflife/issues/2936)) * Added fixes from Marphy Black's [Half-Life Fact Fixes](https://github.com/Revenant100/halflife-FactFilesFixes) -* Try to unstuck player after level transition if stuck in the world [#165](https://github.com/SamVanheer/halflife-updated/issues/165) +* Try to unstuck player after level transition if stuck in the world [#165](https://github.com/twhl-community/halflife-updated/issues/165) * Fixed domain errors in func_tank (halflife issue [#3303](https://github.com/ValveSoftware/halflife/issues/3303)) * Fixed game crashing when triggering certain entities on an empty dedicated server with maxplayers 1 (halflife issue [#3307](https://github.com/ValveSoftware/halflife/issues/3307)) * Access world through global * Access local player through helper function * Removed some obsolete utility functions -* Fixed game_player_equip crashing when given a null activator [#189](https://github.com/SamVanheer/halflife-updated/issues/189) -* Save and restore game_player_equip [#188](https://github.com/SamVanheer/halflife-updated/issues/188) -* Fixed entities with an index greater than 2047 corrupting the client's heap if sent over the network [#191](https://github.com/SamVanheer/halflife-updated/issues/191) +* Fixed game_player_equip crashing when given a null activator [#189](https://github.com/twhl-community/halflife-updated/issues/189) +* Save and restore game_player_equip [#188](https://github.com/twhl-community/halflife-updated/issues/188) +* Fixed entities with an index greater than 2047 corrupting the client's heap if sent over the network [#191](https://github.com/twhl-community/halflife-updated/issues/191) * When using `impulse 107` to get the name of a texture the texture type (as used in `materials.txt`) will also be printed * Added `WRITE_FLOAT` function corresponding to the client's `READ_FLOAT` function * Fixed func_friction not working properly in multiplayer (halflife issue [#1542](https://github.com/ValveSoftware/halflife/issues/1542)) (Thanks L453rh4wk) -* Fixed spray logo using wrong decal after save game load when not using custom spray [#193](https://github.com/SamVanheer/halflife-updated/issues/193) (Thanks Ronin4862) +* Fixed spray logo using wrong decal after save game load when not using custom spray [#193](https://github.com/twhl-community/halflife-updated/issues/193) (Thanks Ronin4862) * Fixed user interface coordinates and sizes being incorrectly adjusted for resolution (halflife issue [#3344](https://github.com/ValveSoftware/halflife/issues/3344)) * Fixed Alien Slave beams staying forever if they exist during a level change (halflife issue [#3104](https://github.com/ValveSoftware/halflife/issues/3104)) * Fixed cycler_wreckage storing time value in int instead of float @@ -376,69 +379,69 @@ Fixes for bugs introduced in beta builds are not included in this list. * Removed old project files & module definition files * Removed duplicate event function declarations, use event_args_t to ensure Intellisense can link declarations and definitions * Removed some double semicolons (Thanks LogicAndTrick) -* Made event playback functions const correct [#41](https://github.com/SamVanheer/halflife-updated/issues/41) -* Removed unused skiplocal parameter [#38](https://github.com/SamVanheer/halflife-updated/issues/38) +* Made event playback functions const correct [#41](https://github.com/twhl-community/halflife-updated/issues/41) +* Removed unused skiplocal parameter [#38](https://github.com/twhl-community/halflife-updated/issues/38) * Made CBaseEntity debug setters const correct * Made HUD string drawing methods const correct * Improved const correctness in engine APIs -* Removed obsolete preprocessor macro checks [#47](https://github.com/SamVanheer/halflife-updated/issues/47) -* Cleaned up uses of the node graph global [#48](https://github.com/SamVanheer/halflife-updated/issues/48) -* Disabled as many Windows.h dependencies as possible [#49](https://github.com/SamVanheer/halflife-updated/issues/49) -* Removed benchmarking functionality [#54](https://github.com/SamVanheer/halflife-updated/issues/54) -* Removed game_controls.lib from the client project [#55](https://github.com/SamVanheer/halflife-updated/issues/55) -* Defined platform-agnostic types for common structures [#56](https://github.com/SamVanheer/halflife-updated/issues/56) -* Removed obsolete engine APIs related to security modules [#57](https://github.com/SamVanheer/halflife-updated/issues/57) -* Removed extern C wrappers around functions [#58](https://github.com/SamVanheer/halflife-updated/issues/58) -* Reworked some uses of platform-specific code to be cross-platform [#59](https://github.com/SamVanheer/halflife-updated/issues/59) -* Merged platform abstraction headers [#53](https://github.com/SamVanheer/halflife-updated/issues/53) -* Removed redundant include guards [#52](https://github.com/SamVanheer/halflife-updated/issues/52) -* Converted all include guards to pragma once [#50](https://github.com/SamVanheer/halflife-updated/issues/50) -* Removed duplicate interface.h/.cpp files [#60](https://github.com/SamVanheer/halflife-updated/issues/60) -* Added pragma once to all headers that need it [#51](https://github.com/SamVanheer/halflife-updated/issues/51) -* Use snprintf and vsnprintf everywhere instead of _snprintf and _vsnprintf [#61](https://github.com/SamVanheer/halflife-updated/issues/61) -* Use WIN32 preprocessor macro instead of _WIN32 [#62](https://github.com/SamVanheer/halflife-updated/issues/62) -* Removed unnecessary _cdecl in function declarations [#63](https://github.com/SamVanheer/halflife-updated/issues/63) -* Removed useless try-catch statement in command menu parsing code [#64](https://github.com/SamVanheer/halflife-updated/issues/64) -* Reworked some uses of platform-specific code to be cross-platform [#59](https://github.com/SamVanheer/halflife-updated/issues/59) -* Save FIELD_BOOLEAN as byte array [#65](https://github.com/SamVanheer/halflife-updated/issues/65) -* Fixed save game system not saving arrays of EHANDLEs if the first half of the array contains null handles (mainly affected Nihilanth's spheres) [#224](https://github.com/SamVanheer/halflife-updated/issues/224) (Thanks Ronin4862) -* Reworked operator new and delete overloads to allocate memory directly [#71](https://github.com/SamVanheer/halflife-updated/issues/71) -* Removed identical line in conditional statement [#75](https://github.com/SamVanheer/halflife-updated/pull/75) (Thanks malortie) +* Removed obsolete preprocessor macro checks [#47](https://github.com/twhl-community/halflife-updated/issues/47) +* Cleaned up uses of the node graph global [#48](https://github.com/twhl-community/halflife-updated/issues/48) +* Disabled as many Windows.h dependencies as possible [#49](https://github.com/twhl-community/halflife-updated/issues/49) +* Removed benchmarking functionality [#54](https://github.com/twhl-community/halflife-updated/issues/54) +* Removed game_controls.lib from the client project [#55](https://github.com/twhl-community/halflife-updated/issues/55) +* Defined platform-agnostic types for common structures [#56](https://github.com/twhl-community/halflife-updated/issues/56) +* Removed obsolete engine APIs related to security modules [#57](https://github.com/twhl-community/halflife-updated/issues/57) +* Removed extern C wrappers around functions [#58](https://github.com/twhl-community/halflife-updated/issues/58) +* Reworked some uses of platform-specific code to be cross-platform [#59](https://github.com/twhl-community/halflife-updated/issues/59) +* Merged platform abstraction headers [#53](https://github.com/twhl-community/halflife-updated/issues/53) +* Removed redundant include guards [#52](https://github.com/twhl-community/halflife-updated/issues/52) +* Converted all include guards to pragma once [#50](https://github.com/twhl-community/halflife-updated/issues/50) +* Removed duplicate interface.h/.cpp files [#60](https://github.com/twhl-community/halflife-updated/issues/60) +* Added pragma once to all headers that need it [#51](https://github.com/twhl-community/halflife-updated/issues/51) +* Use snprintf and vsnprintf everywhere instead of _snprintf and _vsnprintf [#61](https://github.com/twhl-community/halflife-updated/issues/61) +* Use WIN32 preprocessor macro instead of _WIN32 [#62](https://github.com/twhl-community/halflife-updated/issues/62) +* Removed unnecessary _cdecl in function declarations [#63](https://github.com/twhl-community/halflife-updated/issues/63) +* Removed useless try-catch statement in command menu parsing code [#64](https://github.com/twhl-community/halflife-updated/issues/64) +* Reworked some uses of platform-specific code to be cross-platform [#59](https://github.com/twhl-community/halflife-updated/issues/59) +* Save FIELD_BOOLEAN as byte array [#65](https://github.com/twhl-community/halflife-updated/issues/65) +* Fixed save game system not saving arrays of EHANDLEs if the first half of the array contains null handles (mainly affected Nihilanth's spheres) [#224](https://github.com/twhl-community/halflife-updated/issues/224) (Thanks Ronin4862) +* Reworked operator new and delete overloads to allocate memory directly [#71](https://github.com/twhl-community/halflife-updated/issues/71) +* Removed identical line in conditional statement [#75](https://github.com/twhl-community/halflife-updated/pull/75) (Thanks malortie) * Removed unused files (Thanks malortie): - * AI_BaseNPC_Schedule.cpp [#77](https://github.com/SamVanheer/halflife-updated/pull/77) - * glock.cpp [#78](https://github.com/SamVanheer/halflife-updated/pull/78) - * mpstubb.cpp [#80](https://github.com/SamVanheer/halflife-updated/pull/80) - * MOTD.cpp [#81](https://github.com/SamVanheer/halflife-updated/pull/81) - * scoreboard.cpp [#82](https://github.com/SamVanheer/halflife-updated/pull/82) -* Removed DMC and Ricochet VS 2017 projects to match removal of VS 2019 projects [#79](https://github.com/SamVanheer/halflife-updated/pull/79) (Thanks malortie) -* Fixed invalid conversions between bool and other types [#69](https://github.com/SamVanheer/halflife-updated/issues/69) -* Reworked all uses of int and int-like types to use bool when the value is boolean [#83](https://github.com/SamVanheer/halflife-updated/issues/83) -* Enabled certain Clang-tidy checks [#66](https://github.com/SamVanheer/halflife-updated/issues/66) -* Formatted all files and added clang-format configuration file [#84](https://github.com/SamVanheer/halflife-updated/issues/84) -* Removed unused types [#88](https://github.com/SamVanheer/halflife-updated/issues/88) -* Removed unused globals and duplicate global variable forward declarations [#89](https://github.com/SamVanheer/halflife-updated/issues/89) -* Removed obsolete interface APIs [#90](https://github.com/SamVanheer/halflife-updated/issues/90) -* Overhauled vector types to use constexpr, simplify code [#92](https://github.com/SamVanheer/halflife-updated/issues/92) -* Fixed or silence compiler warnings [#91](https://github.com/SamVanheer/halflife-updated/issues/91) -* Removed unused VGUI1 code in vgui_int.cpp [#93](https://github.com/SamVanheer/halflife-updated/issues/93) -* Reworked CSave & CRestore to eliminate null data pointers [#94](https://github.com/SamVanheer/halflife-updated/issues/94) -* Reworked mouse thread code to use standard types [#95](https://github.com/SamVanheer/halflife-updated/issues/95) + * AI_BaseNPC_Schedule.cpp [#77](https://github.com/twhl-community/halflife-updated/pull/77) + * glock.cpp [#78](https://github.com/twhl-community/halflife-updated/pull/78) + * mpstubb.cpp [#80](https://github.com/twhl-community/halflife-updated/pull/80) + * MOTD.cpp [#81](https://github.com/twhl-community/halflife-updated/pull/81) + * scoreboard.cpp [#82](https://github.com/twhl-community/halflife-updated/pull/82) +* Removed DMC and Ricochet VS 2017 projects to match removal of VS 2019 projects [#79](https://github.com/twhl-community/halflife-updated/pull/79) (Thanks malortie) +* Fixed invalid conversions between bool and other types [#69](https://github.com/twhl-community/halflife-updated/issues/69) +* Reworked all uses of int and int-like types to use bool when the value is boolean [#83](https://github.com/twhl-community/halflife-updated/issues/83) +* Enabled certain Clang-tidy checks [#66](https://github.com/twhl-community/halflife-updated/issues/66) +* Formatted all files and added clang-format configuration file [#84](https://github.com/twhl-community/halflife-updated/issues/84) +* Removed unused types [#88](https://github.com/twhl-community/halflife-updated/issues/88) +* Removed unused globals and duplicate global variable forward declarations [#89](https://github.com/twhl-community/halflife-updated/issues/89) +* Removed obsolete interface APIs [#90](https://github.com/twhl-community/halflife-updated/issues/90) +* Overhauled vector types to use constexpr, simplify code [#92](https://github.com/twhl-community/halflife-updated/issues/92) +* Fixed or silence compiler warnings [#91](https://github.com/twhl-community/halflife-updated/issues/91) +* Removed unused VGUI1 code in vgui_int.cpp [#93](https://github.com/twhl-community/halflife-updated/issues/93) +* Reworked CSave & CRestore to eliminate null data pointers [#94](https://github.com/twhl-community/halflife-updated/issues/94) +* Reworked mouse thread code to use standard types [#95](https://github.com/twhl-community/halflife-updated/issues/95) * Replaced stackalloc-based saytext code with fixed-size buffer to avoid using alloca (halflife issue [#3179](https://github.com/ValveSoftware/halflife/issues/3179)) * Use sound array macros (Thanks malortie): - * Alien grunt [#100](https://github.com/SamVanheer/halflife-updated/pull/100) - * Gargantua [#101](https://github.com/SamVanheer/halflife-updated/pull/101) - * Alien slave [#102](https://github.com/SamVanheer/halflife-updated/pull/102) - * Leech [#103](https://github.com/SamVanheer/halflife-updated/pull/103) - * Zombie [#104](https://github.com/SamVanheer/halflife-updated/pull/104) -* Removed unused variables in the client side event playback code [#105](https://github.com/SamVanheer/halflife-updated/pull/105) (Thanks malortie) -* Renamed hl_wpn_glock.cpp to glock.cpp [#108](https://github.com/SamVanheer/halflife-updated/pull/108) (Thanks malortie and JoelTroch for the Linux changes related to this) + * Alien grunt [#100](https://github.com/twhl-community/halflife-updated/pull/100) + * Gargantua [#101](https://github.com/twhl-community/halflife-updated/pull/101) + * Alien slave [#102](https://github.com/twhl-community/halflife-updated/pull/102) + * Leech [#103](https://github.com/twhl-community/halflife-updated/pull/103) + * Zombie [#104](https://github.com/twhl-community/halflife-updated/pull/104) +* Removed unused variables in the client side event playback code [#105](https://github.com/twhl-community/halflife-updated/pull/105) (Thanks malortie) +* Renamed hl_wpn_glock.cpp to glock.cpp [#108](https://github.com/twhl-community/halflife-updated/pull/108) (Thanks malortie and JoelTroch for the Linux changes related to this) * Removed preprocessor checks for other games (Thanks malortie): - * Team Fortress Classic [#110](https://github.com/SamVanheer/halflife-updated/pull/110) - * Condition Zero [#111](https://github.com/SamVanheer/halflife-updated/pull/111) - * Counter-Strike [#112](https://github.com/SamVanheer/halflife-updated/pull/112) - * Day Of Defeat [#113](https://github.com/SamVanheer/halflife-updated/pull/113) - * Blue Shift [#114](https://github.com/SamVanheer/halflife-updated/pull/114) - * Deathmatch Classic and Threewave [#115](https://github.com/SamVanheer/halflife-updated/pull/115) + * Team Fortress Classic [#110](https://github.com/twhl-community/halflife-updated/pull/110) + * Condition Zero [#111](https://github.com/twhl-community/halflife-updated/pull/111) + * Counter-Strike [#112](https://github.com/twhl-community/halflife-updated/pull/112) + * Day Of Defeat [#113](https://github.com/twhl-community/halflife-updated/pull/113) + * Blue Shift [#114](https://github.com/twhl-community/halflife-updated/pull/114) + * Deathmatch Classic and Threewave [#115](https://github.com/twhl-community/halflife-updated/pull/115) * Moved IsFacing function from barney.cpp to h_ai.cpp to help prevent linker errors when copy pasting source file ## Project changes @@ -448,29 +451,32 @@ Fixes for bugs introduced in beta builds are not included in this list. * Updated codebase to use correct functions to allow compilation with newer versions of Visual Studio * Linux compilation fixes (Thanks Shepard and LogicAndTrick) * Made Half-Life client dll depend on server dll to ensure server is built when launching a client debug session -* Update Linux makefiles to use g++ instead of gcc to compile and link all code (Thanks MegaBrutal for bringing this to my attention) [#33](https://github.com/SamVanheer/halflife-updated/issues/33) +* Update Linux makefiles to use g++ instead of gcc to compile and link all code [#33](https://github.com/twhl-community/halflife-updated/issues/33) (Thanks MegaBrutal for bringing this to my attention) * Moved DMC & Ricochet source code, projects, makefiles and fgds to their own repositories. See [README.md](README.md) for more information -* Enabled multiprocessor compilation for Windows builds [#39](https://github.com/SamVanheer/halflife-updated/issues/39) -* Changed default toolset to non-XP compatible one and set Windows SDK version to Windows 10 [#44](https://github.com/SamVanheer/halflife-updated/issues/44) -* Set C++ standard to 17 [#85](https://github.com/SamVanheer/halflife-updated/issues/85) -* Fixed symlinks to Linux and MacOS builds of SDL2 [#137](https://github.com/SamVanheer/halflife-updated/pull/137) (Thanks MegaBrutal) -* Deleted Makefiles and libraries for MacOS X (Half-Life 1 is 32 bit, no longer supported by MacOS) [#141](https://github.com/SamVanheer/halflife-updated/pull/141) (Thanks fel1x-developer) -* Upgraded tool projects to use Visual Studio 2019, fixed as many warnings as possible, all tools aside from smdlexp compile, all tools compiled as C++, most tools work as intended [#138](https://github.com/SamVanheer/halflife-updated/issues/138) (Thanks fel1x-developer for helping with this work) - * Fixed missing archtypes.h header include [#136](https://github.com/SamVanheer/halflife-updated/issues/136) - * Updated readme.txt for latest methods installing MFC, smdlexp and SDL2 [#140](https://github.com/SamVanheer/halflife-updated/pull/140) (Thanks fel1x-developer) - * Removed obsolete VS6 & makefile project files from tools code [#142](https://github.com/SamVanheer/halflife-updated/issues/142) - * Removed bsplib.h & bsplib.cpp (redundant) [#143](https://github.com/SamVanheer/halflife-updated/issues/143) +* Enabled multiprocessor compilation for Windows builds [#39](https://github.com/twhl-community/halflife-updated/issues/39) +* Changed default toolset to non-XP compatible one and set Windows SDK version to Windows 10 [#44](https://github.com/twhl-community/halflife-updated/issues/44) +* Set C++ standard to 17 [#85](https://github.com/twhl-community/halflife-updated/issues/85) +* Fixed symlinks to Linux and MacOS builds of SDL2 [#137](https://github.com/twhl-community/halflife-updated/pull/137) (Thanks MegaBrutal) +* Deleted Makefiles and libraries for MacOS X (Half-Life 1 is 32 bit, no longer supported by MacOS) [#141](https://github.com/twhl-community/halflife-updated/pull/141) (Thanks fel1x-developer) +* Upgraded tool projects to use Visual Studio 2019, fixed as many warnings as possible, all tools aside from smdlexp compile, all tools compiled as C++, most tools work as intended [#138](https://github.com/twhl-community/halflife-updated/issues/138) (Thanks fel1x-developer for helping with this work) + * Fixed missing archtypes.h header include [#136](https://github.com/twhl-community/halflife-updated/issues/136) + * Updated readme.txt for latest methods installing MFC, smdlexp and SDL2 [#140](https://github.com/twhl-community/halflife-updated/pull/140) (Thanks fel1x-developer) + * Removed obsolete VS6 & makefile project files from tools code [#142](https://github.com/twhl-community/halflife-updated/issues/142) + * Removed bsplib.h & bsplib.cpp (redundant) [#143](https://github.com/twhl-community/halflife-updated/issues/143) * Added `fgd/halflife.fgd` * Cleaned up the Linux makefiles to remove obsolete logic and simplify the compilation process * Removed use of obsolete register keyword (caused compiler errors when using Clang++) * Added support for overriding the compiler used when using the Linux makefiles * Fixed the Linux makefiles not working when using Clang++ due to missing `-mno-sse` compiler flag * Added game icons for program icon and Steam library icon -* Use post build event to copy dlls instead of using output directory [#167](https://github.com/SamVanheer/halflife-updated/issues/167) -* Added `-flifetime-dse=1` flag to Linux Makefile to disable compiler optimization that removed entity memory zero-initialization, resulting in the game crashing when any entity touches the world [#187](https://github.com/SamVanheer/halflife-updated/issues/187) (Thanks FreeSlave) -* Set maximum edicts to 2048 in liblist.gam [#181](https://github.com/SamVanheer/halflife-updated/issues/181) +* Use post build event to copy dlls instead of using output directory [#167](https://github.com/twhl-community/halflife-updated/issues/167) +* Added `-flifetime-dse=1` flag to Linux Makefile to disable compiler optimization that removed entity memory zero-initialization, resulting in the game crashing when any entity touches the world [#187](https://github.com/twhl-community/halflife-updated/issues/187) (Thanks FreeSlave) +* Set maximum edicts to 2048 in liblist.gam [#181](https://github.com/twhl-community/halflife-updated/issues/181) * Made the Linux version link statically to the C++ runtime to help avoid problems when running mods on older systems (Thanks a1ba and FreeSlave) * Copy delta.lst when building client or server to ensure mods have correct delta.lst file (Thanks P38TaKjYzY) +* Disabled GCC optimization that prevents mod dlls from unloading after engine calls dlclose +* Fixed third party libraries possibly not being linked to when building Linux server dll (Thanks a1batross) +* Mods made with this SDK will now shut down if they detect they are being run from a Valve game directory (e.g. by placing the dlls in `Half-Life/valve/cl_dlls` and `Half-Life/valve/dlls`). This is not supported and puts users at risk of being VAC banned. Run mods from their intended location only ## Git repository changes @@ -497,7 +503,7 @@ See the full changelog for Half-Life Updated below for changes shared with the b * Fixed bugs causing zoomed in weapons to restore player state incorrectly (halflife issues [#3044](https://github.com/ValveSoftware/halflife/issues/3044) and [#3045](https://github.com/ValveSoftware/halflife/issues/3045)) * Play CTF backpack powerup sound at same volume for all weapons (halflife issue [#3051](https://github.com/ValveSoftware/halflife/issues/3051)) -* Fixed NPC fired 556 and 762 bullets not creating bullet decals half the time (halflife issue [#383](https://github.com/ValveSoftware/halflife/issues/383) and Updated issue [#163](https://github.com/SamVanheer/halflife-updated/issues/163)) +* Fixed NPC fired 556 and 762 bullets not creating bullet decals half the time (halflife issue [#383](https://github.com/ValveSoftware/halflife/issues/383) and Updated issue [#163](https://github.com/twhl-community/halflife-updated/issues/163)) ### Knife @@ -524,12 +530,12 @@ See the full changelog for Half-Life Updated below for changes shared with the b ### Desert Eagle * Fixed Desert Eagle using wrong time base for underwater attack check (halflife issue [#1042](https://github.com/ValveSoftware/halflife/issues/1042)) -* Fixed Desert Eagle laser position not updating when holding down reload button [#95](https://github.com/SamVanheer/halflife-op4-updated/issues/95) (Thanks Ronin4862) +* Fixed Desert Eagle laser position not updating when holding down reload button [#95](https://github.com/twhl-community/halflife-op4-updated/issues/95) (Thanks Ronin4862) * Fixed Desert Eagle laser turning on when reloading immediately after equipping the weapon ### MP5 -* Fixed MP5 shooting animations sometimes playing a deploy animation [#78](https://github.com/SamVanheer/halflife-op4-updated/issues/78) +* Fixed MP5 shooting animations sometimes playing a deploy animation [#78](https://github.com/twhl-community/halflife-op4-updated/issues/78) ### Shotgun @@ -561,20 +567,20 @@ See the full changelog for Half-Life Updated below for changes shared with the b ### General -* Fixed "suspicious" keyvalue not being saved (makes certain friendly NPCs hostile) [#31](https://github.com/SamVanheer/halflife-op4-updated/issues/31) +* Fixed "suspicious" keyvalue not being saved (makes certain friendly NPCs hostile) [#31](https://github.com/twhl-community/halflife-op4-updated/issues/31) * Fixed repel monster entities precaching & spawning wrong entities (halflife issue [#3052](https://github.com/ValveSoftware/halflife/issues/3052)) * Fixed ally grunt monsters resetting other ally grunt monsters' dying schedule if they are both killed at the same time (Thanks FreeSlave) ### Specific NPCs * Fixed allied human grunts using wrong death sound filenames (halflife issue [#3036](https://github.com/ValveSoftware/halflife/issues/3036)) (thanks hammermaps) -* Fixed allied, torch and medic grunts, male assassins and shock troopers continuing to fire for a few seconds after killing the last enemy in an area [#100](https://github.com/SamVanheer/halflife-op4-updated/issues/100) (Thanks Ronin4862 and malortie) +* Fixed allied, torch and medic grunts, male assassins and shock troopers continuing to fire for a few seconds after killing the last enemy in an area [#100](https://github.com/twhl-community/halflife-op4-updated/issues/100) (Thanks Ronin4862 and malortie) * Fixed Shock Troopers not playing death sounds (halflife issue [#3037](https://github.com/ValveSoftware/halflife/issues/3037)) * Fixed Voltigores not playing death sounds (halflife issue [#3039](https://github.com/ValveSoftware/halflife/issues/3039)) * Fixed Voltigore not saving its charge beams (halflife issue [#3049](https://github.com/ValveSoftware/halflife/issues/3049)) * Fixed Voltigore not saving its charged bolt attack correctly (halflife issue [#3050](https://github.com/ValveSoftware/halflife/issues/3050)) * Fixed Pit Drone not using third alert sound (halflife issue [#3053](https://github.com/ValveSoftware/halflife/issues/3053)) -* Fixed Cleansuit scientist using wrong skill value to heal characters [#33](https://github.com/SamVanheer/halflife-op4-updated/issues/33) +* Fixed Cleansuit scientist using wrong skill value to heal characters [#33](https://github.com/twhl-community/halflife-op4-updated/issues/33) * Note: cleansuit scientists in vanilla Opposing Force cannot heal characters * Made cleansuit scientist smell carcasses, meat and garbage like regular scientists * Fixed Black Ops Osprey not interpolating (halflife issue [#3228](https://github.com/ValveSoftware/halflife/issues/3228)) @@ -583,13 +589,13 @@ See the full changelog for Half-Life Updated below for changes shared with the b * Fixed Black Ops Osprey not firing trigger targets Resolves (halflife issue [#3261](https://github.com/ValveSoftware/halflife/issues/3261)) * Fixed Black Ops Osprey engine damage effects showing on wrong engine (halflife issue [#3263](https://github.com/ValveSoftware/halflife/issues/3263)) * Fixed Black Ops Apache not firing trigger targets (halflife issue [#3262](https://github.com/ValveSoftware/halflife/issues/3262)) -* Fixed Gonome trying to play non-existent sounds [#64](https://github.com/SamVanheer/halflife-op4-updated/issues/64) +* Fixed Gonome trying to play non-existent sounds [#64](https://github.com/twhl-community/halflife-op4-updated/issues/64) * Fixed Gonome crashing the game if the player dies while being damaged by Gonome's chest mouth (Thanks malortie) -* Fixed Gonome locking first player on the server when attacking anything [#89](https://github.com/SamVanheer/halflife-op4-updated/issues/89) (Thanks LuckNukeHunter99) +* Fixed Gonome locking first player on the server when attacking anything [#89](https://github.com/twhl-community/halflife-op4-updated/issues/89) (Thanks LuckNukeHunter99) * Fixed human grunts being able to drop weapons in the intro map * Save and restore allied grunt repel entities to ensure spawned NPCs have correct properties (Thanks malortie) * Fixed Male Assassin Snipers not tracking their last shot time properly (Thanks malortie) -* Fixed Engineer not shutting off his blow torch properly [#81](https://github.com/SamVanheer/halflife-op4-updated/issues/81) +* Fixed Engineer not shutting off his blow torch properly [#81](https://github.com/twhl-community/halflife-op4-updated/issues/81) ## User Interface @@ -607,7 +613,7 @@ See the full changelog for Half-Life Updated below for changes shared with the b * Fixed FL_FAKECLIENT flag being cleared in some places (halflife issue [#3256](https://github.com/ValveSoftware/halflife/issues/3256)) * Fixed Health Charger recharge time not using the correct value in Co-op * Fixed ropes breaking at high framerates -* Fixed electrified wire damage being frametime-dependent [#102](https://github.com/SamVanheer/halflife-op4-updated/issues/102) (Thanks malortie) +* Fixed electrified wire damage being frametime-dependent [#102](https://github.com/twhl-community/halflife-op4-updated/issues/102) (Thanks malortie)
@@ -643,7 +649,7 @@ See the full changelog for Half-Life Updated below for changes shared with the b ### MP5 -* Fixed MP5 shooting animations sometimes playing a deploy animation [#78](https://github.com/SamVanheer/halflife-op4-updated/issues/78) +* Fixed MP5 shooting animations sometimes playing a deploy animation [#78](https://github.com/twhl-community/halflife-op4-updated/issues/78) ## Other @@ -657,7 +663,7 @@ See the full changelog for Half-Life Updated below for changes shared with the b ## Project changes * Added tool to convert Blue Shift BSP files to standard Half-Life BSP format -* Added Blue Shift FGD [#2](https://github.com/SamVanheer/halflife-bs-updated/pull/2) (Thanks [Veinhelm](https://github.com/Veinhelm)) +* Added Blue Shift FGD [#2](https://github.com/twhl-community/halflife-bs-updated/pull/2) (Thanks [Veinhelm](https://github.com/Veinhelm)) ## Game installation diff --git a/INSTALL.md b/INSTALL.md index aa671d62c..65195d12d 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -6,15 +6,17 @@ 3. Install the Visual Studio 2022 re-distributable. You can find it in the `hlu/redist` directory. -4. Install the [.NET SDK which includes the runtime](docs/dotnet-tools.md#installing-the-net-sdk). Make sure to install the latest version as the runtime is updated regularly. +4. Install the [.NET 6 SDK which includes the runtime](docs/dotnet-tools.md#installing-the-net-sdk). Make sure to install the latest version as the runtime is updated regularly. -5. Run the [ContentInstaller](docs/tools/content-installer.md) tool in a command line window: +5. Switch Half-Life to the `steam_legacy` branch. The Unified SDK has not been updated to the anniversary version and requires the old version. This is only required during installation; after installation you can switch back to the anniversary version. + +6. Run the [ContentInstaller](docs/tools/content-installer.md) tool in a command line window: ```bat cd "path/to/Half-Life/directory" dotnet "hlu/tools/ContentInstaller.dll" --mod-directory hlu ``` -6. Restart Steam so the game is added to the list of games. +7. Restart Steam so the game is added to the list of games. # Running the game diff --git a/README.md b/README.md index 05439ca21..c641e3d64 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,20 @@ -# **Note**: The Unified SDK is still in development and not ready for use beyond pre-alpha testing and feedback. Do not attempt to use it to make a mod! **Take this warning seriously.** - # Half-Life Unified SDK The [Half-Life Unified SDK](docs/README.md#developer-resources) is a project that provides an updated version of the Half-Life SDK, with full support for the expansion packs Opposing Force and Blue Shift as well as new features. -[![CI/CD](https://github.com/SamVanheer/halflife-unified-sdk/actions/workflows/ci-cd.yml/badge.svg?branch=master)](https://github.com/SamVanheer/halflife-unified-sdk/actions/workflows/ci-cd.yml) +[![CI/CD](https://github.com/twhl-community/halflife-unified-sdk/actions/workflows/ci-cd.yml/badge.svg?branch=master)](https://github.com/twhl-community/halflife-unified-sdk/actions/workflows/ci-cd.yml) The SDK provides a CMake-based project structure with support for Visual Studio 2019 and 2022 on Windows and GCC 11 on Linux, as well as many bug fixes and improvements. Opposing Force and Blue Shift features have been integrated with code refactored to reduce the amount of code duplication. -The goal of the Unified SDK is to allow modders to make mods based on these games, while providing bug fixes that could be applied to the official games as well in addition to bug fixes that would be a breaking change. +**You will need a strong grasp of of C++, build systems like Visual Studio or Make (depending on the platform you're developing for), CMake, command line interfaces, version control systems (Git in particular) and package managers (vcpkg in particular) to make a mod with this SDK. If you do not have experience with these technologies then you will have a very hard time getting started.** + +The goal of the Unified SDK is to allow modders to make mods based on these games, while providing bug fixes that could be applied to the official games as well in addition to bug fixes that would be a breaking change. Check out the documentation linked below for a list of features. A mod installation is also provided to allow players to play these games with all bug fixes applied. It includes files that are required when making a mod based on this SDK. +The Unified SDK works on the `steam_legacy` and anniversary versions of the game but requires the game to be switched to the `steam_legacy` version during installation. See the installation guide for more information. + > Warning >
> Due to how some SDK features are implemented demos will not work properly. Use an external program like OBS to record the game.
@@ -166,3 +168,67 @@ There are basic rules of conduct that should be followed at all times by everyon - Do not repeatedly update an open issue remarking that the issue persists. Remember: Just because the issue you reported was reported here does not mean that it is an issue with Half-Life. As well, should your issue not be resolved immediately, it does not mean that a resolution is not being researched or tested. Patience is always appreciated. + +# Contributors + +This is a list of everybody who contributed to these projects. Thanks for helping to make them better! + +If you believe your name should be on this list make sure to let us know! + +* Sam Vanheer +* JoelTroch +* malortie +* dtugend +* Revenant100 +* fel1x-developer +* LogicAndTrick +* FreeSlave +* zpl-zak +* edgarbarney +* Toodles2You +* Jengerer +* thefoofighter +* Maxxiii +* johndrinkwater +* anchurcn +* DanielOaks +* MegaBrutal +* suXinjke +* IntriguingTiles +* Oxofemple +* YaLTeR +* Ronin4862 +* the man +* vasiavasiavasia95 +* NongBenz +* Hezus +* Anton +* ArroganceJustified +* a1batross +* zaklaus +* Uncle Mike +* Bacontsu +* L453rh4wk +* P38TaKjYzY +* hammermaps +* LuckNukeHunter99 +* Veinhelm +* jay! +* BryanHaley +* λλλλλλ +* Streit +* rbar1um43 +* LambdaLuke87 +* almix +* sabian + +## Special Thanks + +* Valve Software +* Gearbox Software +* Alfred Reynolds +* mikela-valve +* TWHL Community +* Knockout +* Gamebanana +* ModDB diff --git a/UNIFIED_CHANGELOG.md b/UNIFIED_CHANGELOG.md index d6a93385c..6db977c1a 100644 --- a/UNIFIED_CHANGELOG.md +++ b/UNIFIED_CHANGELOG.md @@ -406,7 +406,7 @@ Table of contents: ## Asset Changes -*Main changelog*: [Assets Changelog](https://github.com/SamVanheer/halflife-unified-sdk-assets/blob/master/CHANGELOG.md) +*Main changelog*: [Assets Changelog](https://github.com/twhl-community/halflife-unified-sdk-assets/blob/master/CHANGELOG.md) * Many models have been updated to include all data in a single file (as opposed to split into a main and texture file along with sequence group files) * Variants of the same model from different games and low and high definitions versions have been standardized to include the same properties diff --git a/docs/README.md b/docs/README.md index b037c0490..73b91add8 100644 --- a/docs/README.md +++ b/docs/README.md @@ -13,21 +13,21 @@ The files in this directory and subdirectories contain documentation for the Uni ## Developer Resources -* [SDK Source Code](https://github.com/SamVanheer/halflife-unified-sdk) (Source code for mods and original SDK tools) +* [SDK Source Code](https://github.com/twhl-community/halflife-unified-sdk) (Source code for mods and original SDK tools) * [.NET Tools](dotnet-tools.md) -* [Asset Source Files](https://github.com/SamVanheer/halflife-unified-sdk-assets) -* [C# Tools Source Code](https://github.com/SamVanheer/HalfLife.UnifiedSdk-CSharp) (Source code for new tools written in C#) -* [Releases](https://github.com/SamVanheer/halflife-unified-sdk/releases) (Game installation package) -* [Github Actions](https://github.com/SamVanheer/halflife-unified-sdk/actions) (Automated builds, pre-built binaries for Windows and Linux) -* [Map Decompiler](https://github.com/SamVanheer/HalfLife.UnifiedSdk.MapDecompiler) (Note: GPLv2-licensed) +* [Asset Source Files](https://github.com/twhl-community/halflife-unified-sdk-assets) +* [C# Tools Source Code](https://github.com/twhl-community/HalfLife.UnifiedSdk-CSharp) (Source code for new tools written in C#) +* [Releases](https://github.com/twhl-community/halflife-unified-sdk/releases) (Game installation package) +* [Github Actions](https://github.com/twhl-community/halflife-unified-sdk/actions) (Automated builds, pre-built binaries for Windows and Linux) +* [Map Decompiler](https://github.com/twhl-community/HalfLife.UnifiedSdk.MapDecompiler) (Note: GPLv2-licensed) ## Other Source Code Repositories -* [Half-Life Updated](https://github.com/SamVanheer/halflife-updated) -* [Half-Life: Opposing Force Updated](https://github.com/SamVanheer/halflife-op4-updated) -* [Half-Life: Blue Shift Updated](https://github.com/SamVanheer/halflife-bs-updated) -* [DMC Updated](https://github.com/SamVanheer/dmc-updated) -* [Ricochet Updated](https://github.com/SamVanheer/ricochet-updated) +* [Half-Life Updated](https://github.com/twhl-community/halflife-updated) +* [Half-Life: Opposing Force Updated](https://github.com/twhl-community/halflife-op4-updated) +* [Half-Life: Blue Shift Updated](https://github.com/twhl-community/halflife-bs-updated) +* [DMC Updated](https://github.com/twhl-community/dmc-updated) +* [Ricochet Updated](https://github.com/twhl-community/ricochet-updated) ## Entity guide @@ -89,6 +89,7 @@ The files in this directory and subdirectories contain documentation for the Uni ## Tutorials +* [Using FastDL with servers](tutorials/using-fastdl-with-servers.md) * [Setting up Visual Studio Code to edit PowerShell scripts](tutorials/setting-up-vscode-for-powershell.md) * [Setting up and using dotnet script](tutorials/setting-up-and-using-dotnet-script.md) * [Extracting the Opposing Force relationship table](tutorials/extracting-relationship-table.md) diff --git a/docs/dotnet-tools.md b/docs/dotnet-tools.md index 7a87835e2..a680b6477 100644 --- a/docs/dotnet-tools.md +++ b/docs/dotnet-tools.md @@ -6,7 +6,7 @@ The Unified SDK uses tools written in .NET. These tools are intended to work on ### Installing the .NET SDK -.NET tools require the .NET SDK. +.NET tools require the .NET 6 SDK. You can download the SDK here: https://dotnet.microsoft.com/en-us/download diff --git a/docs/entityguide/README.md b/docs/entityguide/README.md index dd4bf040f..c99b0f003 100644 --- a/docs/entityguide/README.md +++ b/docs/entityguide/README.md @@ -25,6 +25,7 @@ Consult TWHL's entity guide for more complete information about existing entitie * [player_hasweapon](entities/player_hasweapon.md) * [point_teleport](entities/point_teleport.md) * [trigger_changekeyvalue](entities/trigger_changekeyvalue.md) +* [trigger_playerfreeze](entities/trigger_playerfreeze.md) ## Modified entities diff --git a/docs/entityguide/entities/ambient_music.md b/docs/entityguide/entities/ambient_music.md index 3e46a57ce..67e9c4dd2 100644 --- a/docs/entityguide/entities/ambient_music.md +++ b/docs/entityguide/entities/ambient_music.md @@ -8,7 +8,7 @@ You can play and loop music, trigger it to fade out or stop it entirely. ## Keyvalues -* **filename** - Relative name of the file to play. Only applies to the `Play` and `Loop` commands +* **filename** - Relative name of the file to play, starting in the root directory. For example: `media/Half-Life01.mp3`. Only applies to the `Play` and `Loop` commands * **command** - The command to issue. Any of `Play, Loop, Fadeout, Stop` * **target_selector** - How to select players to affect. Any of `AllPlayers, Activator, Radius` * **radius** - If `target_selector` is `Radius`, this is how close the player has to be to be affected by this entity diff --git a/docs/entityguide/entities/trigger_playerfreeze.md b/docs/entityguide/entities/trigger_playerfreeze.md new file mode 100644 index 000000000..5a1ad502e --- /dev/null +++ b/docs/entityguide/entities/trigger_playerfreeze.md @@ -0,0 +1,13 @@ +# trigger_playerfreeze + +**Point entity** + +Point entity that freezes/unfreezes players when triggered. Trigger to freeze, again to unfreeze. This can be repeated as many times as necessary. The entity tracks whether to freeze and unfreeze; it does not toggle the player's current frozen state. + +## Keyvalues + +* **all_players** - Whether to affect all players or the activating player + +## Notes + +* Other entities like `trigger_camera` can also freeze and unfreeze players. Be careful when setting up scripts to prevent players from being unfrozen too early. diff --git a/docs/features/game-configuration-system.md b/docs/features/game-configuration-system.md index cf8e4e88b..52f4840f7 100644 --- a/docs/features/game-configuration-system.md +++ b/docs/features/game-configuration-system.md @@ -201,7 +201,7 @@ Available in map configuration files. #### See Also -* [Hud replacement system](hud-replacement-system.md) +* [Hud sprite system](hud-sprite-system.md) ### HudColor diff --git a/docs/features/network-data-system.md b/docs/features/network-data-system.md index 6feee21dd..a31b9f7fd 100644 --- a/docs/features/network-data-system.md +++ b/docs/features/network-data-system.md @@ -26,9 +26,8 @@ To ensure the correct operation of this system the following cvars are forcibly * sv_allow_dlfile * cl_allowdownload -Two limitations currently exist: +One limitation currently exists: 1. You cannot connect to a dedicated server running from the same game installation as the client. This should never be a problem because the dedicated server tool distributed with the client does not work anymore, and dedicated servers should always be installed separately through SteamCMD. -2. If multiple servers share a FastDL server and transfer the generated file to it they will conflict and use the wrong file. If this does become a problem then a possible solution is to store the file in a subdirectory named after the server IP and port: `1.2.3.4_port`. This would make the filename unique for each server. The client has the server's IP address so this should work, but whether this will actually work or not remains to be seen. The network data system uses the logger named `net_data`. @@ -101,3 +100,7 @@ void AmmoTypeSystem::HandleNetworkDataBlock(NetworkDataBlock& block) Setting `block.ErrorMessage` to a non-empty string aborts serialization/deserialization. Any kind of JSON data type is supported, but it is recommended to keep it as simple as possible to reduce the size of the generated file. + +## See Also + +* [Using FastDL with servers](../tutorials/using-fastdl-with-servers.md) diff --git a/docs/tutorials/using-fastdl-with-servers.md b/docs/tutorials/using-fastdl-with-servers.md new file mode 100644 index 000000000..46a4abe4e --- /dev/null +++ b/docs/tutorials/using-fastdl-with-servers.md @@ -0,0 +1,14 @@ +# Using FastDL with servers running Unified SDK mods + +For the most part servers will work the same as any Half-Life game or mod. There is one caveat involving the [network data system](../features/network-data-system.md) when using a FastDL server. + +The Unified SDK generates a new `networkdata/data.json` file when it loads a map. When not using FastDL the file is immediately downloaded from the server. + +When using FastDL the file server should include a dummy file containing only this: +```cpp +{} +``` + +This is an empty JSON file that will be downloaded and subsequently deleted by the client before downloading the generated file from the game server directly. + +If this file is not present on the file server the game will still download the file from the game server but it will print an error message in the console which may confuse players. diff --git a/src/game/client/CMakeLists.txt b/src/game/client/CMakeLists.txt index d00a9ebd2..7c37bdba1 100644 --- a/src/game/client/CMakeLists.txt +++ b/src/game/client/CMakeLists.txt @@ -1,32 +1,36 @@ include(../shared/game_shared.cmake) -if (UNIX) - # Copy libraries provided by the game to the build directory so we can point the compiler and linker to the files. - configure_file(../../../utils/vgui/lib/linux/vgui${CMAKE_SHARED_LIBRARY_SUFFIX} ${CMAKE_CURRENT_BINARY_DIR}/vgui${CMAKE_SHARED_LIBRARY_SUFFIX} COPYONLY) - configure_file(../../../external/SDL2/lib/libSDL2-2.0${CMAKE_SHARED_LIBRARY_SUFFIX}.0 ${CMAKE_CURRENT_BINARY_DIR}/libSDL2-2.0${CMAKE_SHARED_LIBRARY_SUFFIX}.0 COPYONLY) -endif() - find_package(OpenGL REQUIRED) -add_library(vgui SHARED IMPORTED) +# Begin special case stuff for dynamic libraries included with the game +# vgui and SDL2 are dynamic libraries that are load-time linked by the client +# For Windows this requires us to link with the import libraries +# For Linux this requires the .so files to be located next to the client +# so that the path embedded in the resulting client.so is a filename without any path component to it, +# so that when the library is loaded its path is resolved relative to the executable (hl_linux) +# The actual .so files are next to hl_linux so that's where the paths must point to. +# This is how it was done in the original Linux makefiles as well +# DO NOT DO THIS FOR ANY OTHER LIBRARIES YOU USE! If you must ship a dynamic library you should use the same approach used for OpenAL. -if (WIN32) - set_target_properties(vgui PROPERTIES IMPORTED_IMPLIB "${CMAKE_CURRENT_SOURCE_DIR}/../../../utils/vgui/lib/win32_vc6/vgui.lib") -else() - set_target_properties(vgui PROPERTIES IMPORTED_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/vgui${CMAKE_SHARED_LIBRARY_SUFFIX}") -endif() +add_library(vgui SHARED IMPORTED) +add_library(SDL2 SHARED IMPORTED) target_include_directories(vgui INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/../../../utils/vgui/include) - -add_library(SDL2 SHARED IMPORTED) +target_include_directories(SDL2 INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/../../../external/SDL2/include) if (WIN32) + set_target_properties(vgui PROPERTIES IMPORTED_IMPLIB "${CMAKE_CURRENT_SOURCE_DIR}/../../../utils/vgui/lib/win32_vc6/vgui.lib") set_target_properties(SDL2 PROPERTIES IMPORTED_IMPLIB "${CMAKE_CURRENT_SOURCE_DIR}/../../../external/SDL2/lib/SDL2.lib") else() + # Copy libraries provided by the game to the build directory so we can point the compiler and linker to the files. + configure_file(../../../utils/vgui/lib/linux/vgui${CMAKE_SHARED_LIBRARY_SUFFIX} ${CMAKE_CURRENT_BINARY_DIR}/vgui${CMAKE_SHARED_LIBRARY_SUFFIX} COPYONLY) + configure_file(../../../external/SDL2/lib/libSDL2-2.0${CMAKE_SHARED_LIBRARY_SUFFIX}.0 ${CMAKE_CURRENT_BINARY_DIR}/libSDL2-2.0${CMAKE_SHARED_LIBRARY_SUFFIX}.0 COPYONLY) + + set_target_properties(vgui PROPERTIES IMPORTED_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/vgui${CMAKE_SHARED_LIBRARY_SUFFIX}") set_target_properties(SDL2 PROPERTIES IMPORTED_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/libSDL2-2.0${CMAKE_SHARED_LIBRARY_SUFFIX}.0") endif() -target_include_directories(SDL2 INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/../../../external/SDL2/include) +# End special case stuff for dynamic libraries included with the game add_library(client SHARED) diff --git a/src/game/client/DelayLoad.cpp b/src/game/client/DelayLoad.cpp index 4e2a49018..0c5689931 100644 --- a/src/game/client/DelayLoad.cpp +++ b/src/game/client/DelayLoad.cpp @@ -26,7 +26,7 @@ FARPROC DelayLoad_LoadGameLib(const char* dllName) { ASSERT(dllName); - const auto gameDir = FileSystem_GetGameDirectory(); + const auto& gameDir = FileSystem_GetModDirectoryName(); const auto path = fmt::format("{}/{}", gameDir, dllName); diff --git a/src/game/client/cdll_int.cpp b/src/game/client/cdll_int.cpp index ee9a4658b..b5af7490b 100644 --- a/src/game/client/cdll_int.cpp +++ b/src/game/client/cdll_int.cpp @@ -18,6 +18,8 @@ // this implementation handles the linking of the engine to the DLL // +#include + #include "hud.h" #include "utils/shared_utils.h" #include "netadr.h" @@ -93,6 +95,35 @@ void DLLEXPORT HUD_PlayerMove(playermove_t* ppmove, int server) PM_Move(ppmove, server); } +static bool CL_InitClient() +{ + HUD_SetupServerEngineInterface(); + + EV_HookEvents(); + CL_LoadParticleMan(); + + if (!FileSystem_LoadFileSystem()) + { + return false; + } + + if (UTIL_IsValveGameDirectory()) + { + SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Fatal Error", + "This mod has detected that it is being run from a Valve game directory which is not supported\n" + "Run this mod from its intended location\n\nThe game will now shut down", nullptr); + return false; + } + + if (!g_Client.Initialize()) + { + return false; + } + + // get tracker interface, if any + return true; +} + int DLLEXPORT Initialize(cl_enginefunc_t* pEnginefuncs, int iVersion) { gEngfuncs = *pEnginefuncs; @@ -102,17 +133,13 @@ int DLLEXPORT Initialize(cl_enginefunc_t* pEnginefuncs, int iVersion) memcpy(&gEngfuncs, pEnginefuncs, sizeof(cl_enginefunc_t)); - HUD_SetupServerEngineInterface(); - - EV_HookEvents(); - CL_LoadParticleMan(); - - if (!g_Client.Initialize()) + if (!CL_InitClient()) { + gEngfuncs.Con_DPrintf("Error initializing client\n"); + gEngfuncs.pfnClientCmd("quit\n"); return 0; } - // get tracker interface, if any return 1; } diff --git a/src/game/client/ev_hldm.cpp b/src/game/client/ev_hldm.cpp index 22ff6f810..c95ed0d5d 100644 --- a/src/game/client/ev_hldm.cpp +++ b/src/game/client/ev_hldm.cpp @@ -68,6 +68,12 @@ static int g_tracerCount[MAX_PLAYERS]; void V_PunchAxis(int axis, float punch); extern cvar_t* cl_lw; +extern cvar_t* r_decals; + +static inline bool EV_HLDM_IsBSPModel(physent_t* pe) +{ + return pe != nullptr && (pe->solid == SOLID_BSP || pe->movetype == MOVETYPE_PUSHSTEP); +} // play a strike sound based on the texture that was hit by the attack traceline. VecSrc/VecEnd are the // original traceline endpoints used by the attacker, iBulletType is the type of bullet that hit the texture. @@ -213,6 +219,9 @@ char* EV_HLDM_DamageDecal(physent_t* pe) static char decalname[32]; int idx; + if (pe->rendermode == kRenderTransAlpha) + return nullptr; + if (pe->classnumber == 1) { idx = gEngfuncs.pfnRandomLong(0, 2); @@ -233,7 +242,6 @@ char* EV_HLDM_DamageDecal(physent_t* pe) void EV_HLDM_GunshotDecalTrace(pmtrace_t* pTrace, char* decalName) { int iRand; - physent_t* pe; gEngfuncs.pEfxAPI->R_BulletImpactParticles(pTrace->endpos); @@ -260,17 +268,12 @@ void EV_HLDM_GunshotDecalTrace(pmtrace_t* pTrace, char* decalName) } } - pe = gEngfuncs.pEventAPI->EV_GetPhysent(pTrace->ent); - // Only decal brush models such as the world etc. - if (decalName && '\0' != decalName[0] && pe && (pe->solid == SOLID_BSP || pe->movetype == MOVETYPE_PUSHSTEP)) + if (decalName && '\0' != decalName[0] && r_decals->value > 0) { - if (0 != r_decals->value) - { - gEngfuncs.pEfxAPI->R_DecalShoot( - gEngfuncs.pEfxAPI->Draw_DecalIndex(gEngfuncs.pEfxAPI->Draw_DecalIndexFromName(decalName)), - gEngfuncs.pEventAPI->EV_IndexFromTrace(pTrace), 0, pTrace->endpos, 0); - } + gEngfuncs.pEfxAPI->R_DecalShoot( + gEngfuncs.pEfxAPI->Draw_DecalIndex(gEngfuncs.pEfxAPI->Draw_DecalIndexFromName(decalName)), + gEngfuncs.pEventAPI->EV_IndexFromTrace(pTrace), 0, pTrace->endpos, 0); } } @@ -280,7 +283,7 @@ void EV_HLDM_DecalGunshot(pmtrace_t* pTrace, int iBulletType) pe = gEngfuncs.pEventAPI->EV_GetPhysent(pTrace->ent); - if (pe && pe->solid == SOLID_BSP) + if (EV_HLDM_IsBSPModel(pe)) { switch (iBulletType) { @@ -958,7 +961,7 @@ void EV_FireGauss(event_args_t* args) if (pEntity == nullptr) break; - if (pEntity->solid == SOLID_BSP) + if (EV_HLDM_IsBSPModel(pEntity)) { float n; @@ -1206,7 +1209,7 @@ void EV_FireCrossbow2(event_args_t* args) physent_t* pe = gEngfuncs.pEventAPI->EV_GetPhysent(tr.ent); // Not the world, let's assume we hit something organic ( dog, cat, uncle joe, etc ). - if (pe->solid != SOLID_BSP) + if (!EV_HLDM_IsBSPModel(pe)) { switch (gEngfuncs.pfnRandomLong(0, 1)) { diff --git a/src/game/client/sound/GameSoundSystem.cpp b/src/game/client/sound/GameSoundSystem.cpp index c6aa7b8c3..6bf7735b4 100644 --- a/src/game/client/sound/GameSoundSystem.cpp +++ b/src/game/client/sound/GameSoundSystem.cpp @@ -638,9 +638,7 @@ void GameSoundSystem::ConfigureHRTF(bool enabled) void GameSoundSystem::SetVolume() { - // Need to multiply by 8 here to more closely match the volume used in the original engine. - // See SND_InitScaletable in Quake 1 for where this value is also used. - alListenerf(AL_GAIN, m_Volume->value * 8); + alListenerf(AL_GAIN, m_Volume->value); } std::string_view GameSoundSystem::GetSoundName(const SoundData& sound) const diff --git a/src/game/client/ui/hud/text_message.cpp b/src/game/client/ui/hud/text_message.cpp index 8dbcfdf7d..78143e8f7 100644 --- a/src/game/client/ui/hud/text_message.cpp +++ b/src/game/client/ui/hud/text_message.cpp @@ -20,6 +20,10 @@ // this class routes messages through titles.txt for localisation // +#include +#include +#include + #include "hud.h" #include "vgui_TeamFortressViewport.h" @@ -40,50 +44,70 @@ bool CHudTextMessage::Init() // the new value is pushed into dst_buffer char* CHudTextMessage::LocaliseTextString(const char* msg, char* dst_buffer, int buffer_size) { + assert(buffer_size > 0); + char* dst = dst_buffer; - int remainingBufferSize = buffer_size; - for (const char* src = msg; *src != 0 && remainingBufferSize > 0; remainingBufferSize--) + // Subtract one so we have space for the null terminator no matter what. + std::size_t remainingBufferSize = buffer_size - 1; + for (const char* src = msg; *src != '\0' && remainingBufferSize > 0;) { if (*src == '#') { // cut msg name out of string static char word_buf[255]; - char* wdst = word_buf; const char* word_start = src; - for (++src; (*src >= 'A' && *src <= 'z') || (*src >= '0' && *src <= '9'); wdst++, src++) + + ++src; + { - *wdst = *src; + const auto end = std::find_if_not(src, src + std::strlen(src), [](auto c) + { return (c >= 'A' && c <= 'z') || (c >= '0' && c <= '9'); }); + + const std::size_t nameLength = end - src; + + const std::size_t count = std::min(std::size(word_buf) - 1, nameLength); + + if (count < nameLength) + { + gEngfuncs.Con_DPrintf( + "CHudTextMessage::LocaliseTextString: Token name starting at index %d too long in message \"%s\"\n", + static_cast(src - msg), msg); + } + + std::strncpy(word_buf, src, count); + word_buf[count] = '\0'; + + src += nameLength; } - *wdst = 0; // lookup msg name in titles.txt client_textmessage_t* clmsg = TextMessageGet(word_buf); - if (!clmsg || !(clmsg->pMessage)) + if (clmsg && clmsg->pMessage) { - src = word_start; - *dst = *src; - dst++, src++; + // copy string into message over the msg name + const std::size_t count = std::min(remainingBufferSize, std::strlen(clmsg->pMessage)); + + std::strncpy(dst, clmsg->pMessage, count); + + dst += count; + remainingBufferSize -= count; continue; } - // copy string into message over the msg name - for (const char* wsrc = clmsg->pMessage; *wsrc != 0; wsrc++, dst++) - { - *dst = *wsrc; - } - *dst = 0; - } - else - { - *dst = *src; - dst++, src++; - *dst = 0; + src = word_start; } + + *dst = *src; + dst++; + src++; + + --remainingBufferSize; } - dst_buffer[buffer_size - 1] = 0; // ensure null termination + *dst = '\0'; // ensure null termination + return dst_buffer; } @@ -91,7 +115,7 @@ char* CHudTextMessage::LocaliseTextString(const char* msg, char* dst_buffer, int char* CHudTextMessage::BufferedLocaliseTextString(const char* msg) { static char dst_buffer[1024]; - LocaliseTextString(msg, dst_buffer, 1024); + LocaliseTextString(msg, dst_buffer, std::size(dst_buffer)); return dst_buffer; } diff --git a/src/game/server/activity.h b/src/game/server/activity.h index fbb336d6f..985bf46fd 100644 --- a/src/game/server/activity.h +++ b/src/game/server/activity.h @@ -15,6 +15,8 @@ #pragma once +#include + enum Activity { ACT_RESET = 0, // Set m_Activity to this invalid value to force a reset to m_IdealActivity @@ -96,6 +98,7 @@ enum Activity ACT_FLINCH_RIGHTLEG, }; +inline auto format_as(Activity a) { return fmt::underlying(a); } struct activity_map_t { diff --git a/src/game/server/entities/NPCs/schedule.cpp b/src/game/server/entities/NPCs/schedule.cpp index 1998e0db6..bf4353637 100644 --- a/src/game/server/entities/NPCs/schedule.cpp +++ b/src/game/server/entities/NPCs/schedule.cpp @@ -1300,7 +1300,7 @@ void CBaseMonster::StartTask(const Task_t* pTask) default: { - AILogger->warn("No StartTask entry for {}", (SHARED_TASKS)pTask->iTask); + AILogger->warn("No StartTask entry for {}", pTask->iTask); break; } } diff --git a/src/game/server/entities/func_break.cpp b/src/game/server/entities/func_break.cpp index 61eaa903c..01d091ecf 100644 --- a/src/game/server/entities/func_break.cpp +++ b/src/game/server/entities/func_break.cpp @@ -765,6 +765,8 @@ class CPushable : public CBreakable // breakables use an overridden takedamage bool TakeDamage(CBaseEntity* inflictor, CBaseEntity* attacker, float flDamage, int bitsDamageType) override; + int DamageDecal(int bitsDamageType) override; + static const char* m_soundNames[3]; int m_lastSound; // no need to save/restore, just keeps the same sound from playing twice in a row float m_maxSpeed; @@ -958,3 +960,11 @@ bool CPushable::TakeDamage(CBaseEntity* inflictor, CBaseEntity* attacker, float return true; } + +int CPushable::DamageDecal(int bitsDamageType) +{ + if (FBitSet(pev->spawnflags, SF_PUSH_BREAKABLE)) + return CBreakable::DamageDecal(bitsDamageType); + + return CBaseEntity::DamageDecal(bitsDamageType); +} diff --git a/src/game/server/entities/items/ggrenade.cpp b/src/game/server/entities/items/ggrenade.cpp index b578f58df..786b83a4f 100644 --- a/src/game/server/entities/items/ggrenade.cpp +++ b/src/game/server/entities/items/ggrenade.cpp @@ -262,7 +262,10 @@ void CGrenade::BounceTouch(CBaseEntity* pOther) if (pev->framerate > 1.0) pev->framerate = 1; else if (pev->framerate < 0.5) + { pev->framerate = 0; + pev->frame = 0; + } } void CGrenade::SlideTouch(CBaseEntity* pOther) diff --git a/src/game/server/game.cpp b/src/game/server/game.cpp index 4da1e4b51..d48a45cda 100644 --- a/src/game/server/game.cpp +++ b/src/game/server/game.cpp @@ -55,6 +55,28 @@ cvar_t sv_entityinfo_eager{"sv_entityinfo_eager", "1", FCVAR_SERVER}; cvar_t sv_schedule_debug{"sv_schedule_debug", "0", FCVAR_SERVER}; +static bool SV_InitServer() +{ + if (!FileSystem_LoadFileSystem()) + { + return false; + } + + if (UTIL_IsValveGameDirectory()) + { + g_engfuncs.pfnServerPrint("This mod has detected that it is being run from a Valve game directory which is not supported\n" + "Run this mod from its intended location\n\nThe game will now shut down\n"); + return false; + } + + if (!g_Server.Initialize()) + { + return false; + } + + return true; +} + // Register your console variables here // This gets called one time when the game is initialied void GameDLLInit() @@ -66,6 +88,14 @@ void GameDLLInit() g_footsteps = CVAR_GET_POINTER("mp_footsteps"); g_psv_cheats = CVAR_GET_POINTER("sv_cheats"); + if (!SV_InitServer()) + { + g_engfuncs.pfnServerPrint("Error initializing server\n"); + // Shut the game down as soon as possible. + SERVER_COMMAND("quit\n"); + return; + } + CVAR_REGISTER(&displaysoundlist); CVAR_REGISTER(&allow_spectators); @@ -110,13 +140,6 @@ void GameDLLInit() // Link user messages immediately so there are no race conditions. LinkUserMessages(); - - if (!g_Server.Initialize()) - { - // Shut the game down ASAP - SERVER_COMMAND("quit\n"); - return; - } } void GameDLLShutdown() diff --git a/src/game/server/gamerules/CHalfLifeMultiplay.cpp b/src/game/server/gamerules/CHalfLifeMultiplay.cpp index 54e7e4abf..e9e1b5ec4 100644 --- a/src/game/server/gamerules/CHalfLifeMultiplay.cpp +++ b/src/game/server/gamerules/CHalfLifeMultiplay.cpp @@ -576,7 +576,7 @@ void CHalfLifeMultiplay::DeathNotice(CBasePlayer* pVictim, CBaseEntity* pKiller, else { // killed by the world - Logger->trace("{} committed suicide with committed suicide with \"{}\" (world)", PlayerLogInfo{*pVictim}, killer_weapon_name); + Logger->trace("{} committed suicide with \"{}\" (world)", PlayerLogInfo{*pVictim}, killer_weapon_name); } MESSAGE_BEGIN(MSG_SPEC, SVC_DIRECTOR); diff --git a/src/game/server/sound/SentencesSystem.cpp b/src/game/server/sound/SentencesSystem.cpp index 2ad7dbe69..3d5ba2b70 100644 --- a/src/game/server/sound/SentencesSystem.cpp +++ b/src/game/server/sound/SentencesSystem.cpp @@ -156,14 +156,15 @@ bool SentencesParser::ParseSentences(const json& input) for (const auto& sentenceName : groupContents) { - if (auto sentenceIndex = m_SentenceToIndexMap.find(sentenceName.get()); + const std::string sentenceNameString = sentenceName.get(); + if (auto sentenceIndex = m_SentenceToIndexMap.find(sentenceNameString); sentenceIndex != m_SentenceToIndexMap.end()) { it->second.Sentences.push_back(static_cast(sentenceIndex->second)); } else { - m_Logger->warn("Group \"{}\": Sentence \"{}\" not found", groupName, sentenceName); + m_Logger->warn("Group \"{}\": Sentence \"{}\" not found", groupName, sentenceNameString); } } } diff --git a/src/game/shared/utils/LogSystem.cpp b/src/game/shared/utils/LogSystem.cpp index 9e4daf7ca..819675d10 100644 --- a/src/game/shared/utils/LogSystem.cpp +++ b/src/game/shared/utils/LogSystem.cpp @@ -405,7 +405,7 @@ void LogSystem::SetFileLoggingEnabled(bool enable) if (enable && !m_FileSink) { // Separate log files into client and server files to avoid races between the two. - const std::string gameDir = FileSystem_GetGameDirectory(); + const std::string& gameDir = FileSystem_GetModDirectoryName(); const std::string baseFileName = fmt::format("{}/logs/{}/{}.log", gameDir, GetShortLibraryPrefix(), m_Settings.LogFile.BaseFileName.value_or(DefaultBaseFileName)); diff --git a/src/game/shared/utils/filesystem_utils.cpp b/src/game/shared/utils/filesystem_utils.cpp index be0b1637e..6390e87a7 100644 --- a/src/game/shared/utils/filesystem_utils.cpp +++ b/src/game/shared/utils/filesystem_utils.cpp @@ -52,6 +52,7 @@ static CSysModule* g_pFileSystemModule = nullptr; // The engine's filesystem doesn't provide functions to do this so we have to work around it. static std::string g_GameDirectory; static std::string g_ModDirectory; +static std::string g_ModDirectoryName; static bool FileSystem_InitializeGameDirectory() { @@ -96,18 +97,17 @@ static bool FileSystem_InitializeGameDirectory() gameDirectory.shrink_to_fit(); - std::string modDirectory; - modDirectory.resize(BufferSize); + g_ModDirectoryName.resize(BufferSize); #ifdef CLIENT_DLL - modDirectory = gEngfuncs.pfnGetGameDirectory(); + g_ModDirectoryName = gEngfuncs.pfnGetGameDirectory(); #else - g_engfuncs.pfnGetGameDir(modDirectory.data()); - modDirectory.resize(std::strlen(modDirectory.c_str())); + g_engfuncs.pfnGetGameDir(g_ModDirectoryName.data()); + g_ModDirectoryName.resize(std::strlen(g_ModDirectoryName.c_str())); #endif g_GameDirectory = std::move(gameDirectory); - g_ModDirectory = g_GameDirectory + DefaultPathSeparatorChar + modDirectory; + g_ModDirectory = g_GameDirectory + DefaultPathSeparatorChar + g_ModDirectoryName; return true; } @@ -180,17 +180,9 @@ void FileSystem_FreeFileSystem() } } -std::string FileSystem_GetGameDirectory() +const std::string& FileSystem_GetModDirectoryName() { -#ifdef CLIENT_DLL - return gEngfuncs.pfnGetGameDirectory(); -#else - char gameDir[MAX_PATH_LENGTH]; - g_engfuncs.pfnGetGameDir(gameDir); - gameDir[sizeof(gameDir) - 1] = '\0'; - - return gameDir; -#endif + return g_ModDirectoryName; } void FileSystem_FixSlashes(std::string& fileName) @@ -339,3 +331,30 @@ bool FileSystem_WriteTextToFile(const char* fileName, const char* text, const ch return false; } + +constexpr const char* ValveGameDirectoryPrefixes[] = + { + "valve", + "gearbox", + "bshift", + "ricochet", + "dmc", + "cstrike", + "czero", // Also covers Deleted Scenes (czeror) + "dod", + "tfc"}; + +bool UTIL_IsValveGameDirectory() +{ + const std::string& modDirectoryName = FileSystem_GetModDirectoryName(); + + for (const auto prefix : ValveGameDirectoryPrefixes) + { + if (strnicmp(modDirectoryName.c_str(), prefix, strlen(prefix)) == 0) + { + return true; + } + } + + return false; +} diff --git a/src/game/shared/utils/filesystem_utils.h b/src/game/shared/utils/filesystem_utils.h index 9a1a04c5a..c00afcf7e 100644 --- a/src/game/shared/utils/filesystem_utils.h +++ b/src/game/shared/utils/filesystem_utils.h @@ -44,7 +44,10 @@ inline IFileSystem* g_pFileSystem = nullptr; bool FileSystem_LoadFileSystem(); void FileSystem_FreeFileSystem(); -std::string FileSystem_GetGameDirectory(); +/** + * @brief Returns the mod directory name. Only valid to call after calling FileSystem_LoadFileSystem. + */ +const std::string& FileSystem_GetModDirectoryName(); /** * @brief Replaces occurrences of ::AlternatePathSeparatorChar with ::DefaultPathSeparatorChar. @@ -104,6 +107,12 @@ std::vector FileSystem_LoadFileIntoBuffer(const char* fileName, FileC */ bool FileSystem_WriteTextToFile(const char* fileName, const char* text, const char* pathID = nullptr); +/** + * @brief Returns @c true if the current game directory is that of a Valve game. + * Any directory whose name starts with that of a Valve game's directory name is considered to be one, matching Steam's behavior. + */ +bool UTIL_IsValveGameDirectory(); + /** * @brief Helper class to automatically close the file handle associated with a file. */ diff --git a/vcpkg b/vcpkg index 9259a0719..16ee2ecb3 160000 --- a/vcpkg +++ b/vcpkg @@ -1 +1 @@ -Subproject commit 9259a0719d94c402aae2ab7975bc096afdec15df +Subproject commit 16ee2ecb31788c336ace8bb14c21801efb6836e4 diff --git a/vcpkg.json b/vcpkg.json index e424e06de..94fc9bf28 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -2,21 +2,21 @@ "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg/master/scripts/vcpkg.schema.json", "name": "halflife-unified-sdk", "version-semver": "0.1.0", - "builtin-baseline": "9259a0719d94c402aae2ab7975bc096afdec15df", + "builtin-baseline": "16ee2ecb31788c336ace8bb14c21801efb6836e4", "dependencies": [ { "name": "fmt", - "version>=": "9.0.0", + "version>=": "10.1.1", "default-features": false }, { "name": "spdlog", - "version>=": "1.10.0#1", + "version>=": "1.12.0", "default-features": false }, { "name": "nlohmann-json", - "version>=": "3.11.2", + "version>=": "3.11.3", "default-features": false }, { @@ -26,7 +26,7 @@ }, { "name": "angelscript", - "version>=": "2.35.1#1", + "version>=": "2.36.1#1", "default-features": false, "features": ["addons"] },