Some users reported issues with the game no longer launching if operated on a system with ASLR disabled. This patch takes these scenarios into account. We should not look for ASLR address space if ASLR is disabled as this will fail.
The Rui library contains assertions but if they fail they never get logged anywhere. Implemented handler that will log it to the console if cvar `rui_codeAsserts` is set (enabled by default because these are very rare/never happen and we should catch and fix them at all times).
This fixes every overlay (including the VGui sprite animations for the SRAM rocket launcher). This is the correct way of fixing the function as it was clearly not updated to match the new changes unlike Hud_SetScaleX() and Hud_SetScaleY().
If sv_cheats is 1 and we run "weapon_reparse" on the client, the client will forward this command to the server as well so the server could reload its weapon scripts and be in-sync. However this command did not have the proper flags for this to function. Dedicated builds now have the right flags for this command, it now functions as intended.
We should return with the result -1 instead of executing the rest of the code because a slot idx of -1 is invalid and our structure pointer will be NULL. Very rare crash but it has happened a few times since the initial release of this project!
Engine bug that was caused after a refactor of the HUD system. The scalars were set to a child object instead of the root structure which is what Hud_SetScale() expects. Reworked the assembly code and the overlays now draw properly on the smart pistol and rocket launcher.
g_pEngineClient is an interface only class (does not contain any members), however it was pointing directly to the vftable instead of to a pointer to a vftable, therefore, using its vftable would cause a crash or otherwise undefined behavior. Changed initialization to point to the pointer to the vftable instead to yield correct behavior.
All 3 elements are of type i32, set dword instead of qword wide; reduces stack frame with 2 bytes and ensures we do not write past our array. Also fixed a type in a comment.
When using the gpu driven texture streaming system, alphasort world textures wouldn't stream because the compute shader was never executed during the alphasort render pass. The system has been modified to accomodate for the 3rd render pass, and the compute shaders now gets executed when alphasort gets rendered. Translucent materials now appear correct and stream in properly on all levels.
A code path was missed during the static texture array increase; r15 was set to module base but should've been set to the address of our new static texture array. The crash occurs when setting the cvar `stream_mode` to "all". After this change, all stream modes work as intended. This is so far the only issue that has encountered after increasing the array in commit 4de8a7d8ae.
The JSON root is now an array of objects, instead of an object with enumerated objects who's total size was controlled by another field name. This significantly simplifies the file format and parsing code. Also added a object type check for each ban entry to make sure we don't process faulty entries; these get reported to the console as a warning.
The net key is configured before the first Cbuf_Execute() call is fired, this results in the key getting configured twice when using `+net_useRandomKey <val>` over the command line. Make a dedicated command line argument (`-norandomkey`) to fix this problem.
The game is supposed to load the Mandarin streaming source file when schinese or tchinese is selected, however this didn't happen as the game's language is handled slightly different. Load mandaring streaming source files when either of the 2 languages are selected as these files contain the required audio for both. Fixes the issue where Mandarin audio couldn't be used when using schinese or tchinese language.
We need to look for the library from the directory the RPak was being loaded from. Use the new feature introduced in commit 17c07be6af to make sure we always attempt to LoadLibrary() the image exactly from where the rpak was loaded from.
This is useful for when we load an from a mod directory, and this rpak has a .dll which needs to be loaded along with the rpak, instead of going over each mod again (since caller doesn't know actual open path) we can just retrieve the actual load path of our rpak and from there LoadLibrary the linked image file.
Add command line arguments to allow disabling the plugin system, also placed the debug prints behind a convar that can be toggled through the command line and developer console. The actual instance loading/unloading code has also been moved into the class.
The command handler used the IVEngineClient interface to check if we are connected and are on a listen server. This interface is NULL on the dedicated server. The command handler has been rewritten to take this into account now.
vsnprintf always null terminates the array unless an error occured. However, we always null the last char in the array. If an error occured and we do not null the start of the array, we will print uninitialized memory (potentially until the end of the array). Check for error and null the start if encoding failed.
vsnprintf always null terminates the array unless an error occured. However, we always null the last char in the array. If an error occured and we do not null the start of the array, we will print uninitialized memory (potentially until the end of the array). Check for error and null the start if encoding failed.
vsnprintf always null terminates the array unless an error occured. However, we always null the last char in the array. If an error occured and we do not null the start of the array, we will print uninitialized memory (potentially until the end of the array). Check for error and null the start if encoding failed.
vsnprintf always null terminates the array unless an error occured. However, we always null the last char in the array. If an error occured and we do not null the start of the array, we will print uninitialized memory (potentially until the end of the array). Check for error and null the start if encoding failed.
vsnprintf always null terminates the array unless an error occured. However, we always null the last char in the array. If an error occured and we do not null the start of the array, we will print uninitialized memory (potentially until the end of the array). Check for error and null the start if encoding failed.
The tenary operator on the pak->maxCopySize member variable got optimized to always assign PAK_DECODE_OUT_RING_BUFFER_MASK. The result of the flag checks to determine if the pak is compressed has now been stored off in a stack variable which is reused. This now compiles to correct code and no longer crashes when loading. Also casted size values to 64 bit wide types to yield better output code.
The pluginSDK has been overhauled with the newly finished interface (as of commit e2fb2d8632). The PluginSDK now implements its features and shows the basics (instantiating interfaces, creating console variables and console commands, creating script function bindings, etc..). The PluginSDK is now considered finished.
- Implemented proper pluginsystem shutdown routine
- Implemented logger interface (plugins can now log to all interfaces just like the SDK!)
- Added script function registration callbacks (the required code hooks for these will be added very soon)
Allow the engine's CFileSystem_Stdio interface to be instantiated (this was supposed to be exposed, but due to the game being static linked, this has been optimized out).
Allow the engine's ICvar interface to be instantiated (this was supposed to be exposed, but due to the game being static linked, this has been optimized out).
In order for mods to interface with core scripts, they must be precompiled before the core scripts are. The internal SQVM_FreeCompileBuffer() call had to be defered until after our mod scripts are compiled to make this work.
Allows us to determine if we are currently transitioning into loading a level. If this returns true we are the host, very robust way of checking if we are the host during the load of a level.
We should never look through mods if the provided path is absolute! Skip these. CPackedStore::OpenPackFile() always provides an absolute path because CPackedStore::MountVPKFile() converts the relative path to an absolute one using Q_MakeAbsolutePath().
The inlined FS_OpenAsyncFile() functions have now been de-inlined at assembly level; the call sites have been completely reworked in StreamDB_Init(), ColorCorrection_LoadAsync() and CPackedStore::OpenPackFile(), all FS_OpenAsyncFile() calls are now routed properly to the SDK's implementation and therefore the debug channel id's will always be set. Uncommented the assert to catch any regressions caused by future changes.
This is no longer needed because we have an actual mod system now. Deprecated since this avoids extra bloat in FS_OpenAsyncFile(). The path is now used for writing pak data (i.e. if we compress or decompress a pak, it will be written to this path now).