The decompile of this function was still incorrect, after looking at the raw disassembly, bool v36 and bool v35 are now set correctly. Also, a float was never set and the decompiler assigned a local to an incorrect one for some math that was supposed to set the inputSampleFrametime, causing it to work as a counter magnet when target compensation was activated. This now also has been set correctly according to the assembly of the function itself, and now works as intended. So far, all bugs appear to be fixed in this function, its pending tests by users.
Fix incorrect type for g_aimCurveConfig, its a static array, so it needs to be a single pointer not a double. Also fixed several blocks inside CurveLook that did not match the assembly code of the game. The aim-assist code is still broken however, pending research.
Change callbacks actually take a structure of 2 pointers, one being for the callback itself, and the other being 'userdata' which typically is used to sync the ConVar with VGUI slider elements. This issue was noticed after implementing the ADS scalars and attempting to hook them up to VGUI, only to find out it would crash due to this lacking detail. All change callback prototypes had to be adjusted.
Implemented by popular demand. Allows setting different sensitivity values per optic zoom level on a weapon. The mouse input handler already had this, but the controller one didn't so it had to be implemented here.
This function didn't decompile properly, so a bunch of manual assembly work had to be used to reconstruct the truncated bits. The code does work correct for the most part. The call to the subroutine 'sub_1405AD760' has been commented as the parameter appears incorrect; passes in the address of a bool but indexes 4 bytes outside the size of a bool. Most likely incorrect decompile/disasm. Currently being investigated.
Mutex is technically no longer needed as imgui now draws in main and gets buffer swapped / rendered in the render thread just like the rest of the game. But the mutex was still in because of the shared script function 'Script_GetAvailablePlaylists' that can be used on the server. Both the 'playlist_reload' and 'downloadPlaylists' commands will now join the active server job if ran to prevent crashing in the engine or sdk when ran during the game.
There was also a performance difference between 'playlist_reload' and 'downloadPlaylists' while the commands are identical. There was a bug where the 'playlist_reload' one called 'Playlists_SDKInit' twice. This has also been fixed in this commit.
Properly load it from CServerGameDLL::DLLInit (and new in this commit, the client's shared globals from CHLClient::Init), this way we can also avoid the double dereference which improves performance. Also performed an architectural change where anything outside Game DLL code uses the shared interface pointer instead of the objects directly.
Use Min instead of an inline check, this generates better assembly code. Also made all the used defines a float to avoid having to cast each time since we aren't working with double precision floating points here.
The interface layout and implementation in the SDK was different than that of the engine. This has been changed to maintain ABI compatibility and to ensure the same values are generated.