108 Commits

Author SHA1 Message Date
Kawe Mazidjatari
06b673dc84 Recast: rename constant
A more descriptive and correct name.
2024-08-14 11:34:07 +02:00
Kawe Mazidjatari
b63cb1d52c Recast: improve naming consistency for the traverse system
Traversal and traverse were mixed in variable/function naming. Forced consistency. No logic was changed this patch.
2024-08-09 14:35:47 +02:00
Kawe Mazidjatari
c4ac63ed69 Server: disable view punch by default
View punch on player in Hip is also disabled in retail apparently. Reflect behavior in SDK.
2024-08-08 14:32:21 +02:00
Kawe Mazidjatari
deb59074c1 Server: only disable view punch during aim by default 2024-08-07 17:35:29 +02:00
Kawe Mazidjatari
ffb8c5992d Server: add cvar that allows enabling/disabling view punch when taking damage 2024-08-07 13:01:50 +02:00
Kawe Mazidjatari
8cfce5ea9a Client: cleanup and optimize C_Player::CurveLook
Don't call C_BaseCombatCharacter::GetActiveWeapon twice.
2024-08-06 20:30:07 +02:00
Kawe Mazidjatari
2348a2dc61 Client: make C_WeaponX::HasTargetZoomFOV() const 2024-08-06 20:29:16 +02:00
Kawe Mazidjatari
07fd1cef8e Client: add method to check if weapon is melee 2024-08-06 20:28:52 +02:00
Kawe Mazidjatari
2914027574 Client: fix aim magnet bug and several other issues with CurveLook
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.
2024-08-06 00:59:59 +02:00
Kawe Mazidjatari
886f1c6a53 Client: fix numerous issues with CurveLook rebuild
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.
2024-08-05 20:06:26 +02:00
Kawe Mazidjatari
08a69db020 Client: fix nullptr deref crash when auto aim is enabled 2024-08-05 02:09:03 +02:00
Kawe Mazidjatari
f8331d7ac7 Client: only run ADS per-optic when zoomed in
Should only fire this code when zoomed in.
2024-08-05 01:42:24 +02:00
Kawe Mazidjatari
2fd2873536 Client: properly clamp gamepad ads scalars 2024-08-05 00:39:40 +02:00
Kawe Mazidjatari
704498aecb Client: add per-optic sensitivity scalars to CurveLook
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.
2024-08-04 17:28:33 +02:00
Kawe Mazidjatari
f9eb989b3b Game: add method for calculating zoom FOV interp 2024-08-04 17:25:38 +02:00
Kawe Mazidjatari
bfdf601d0d Client: add note, cleanup curve look code and enable it
So far tested, works correctly. Pending test by community.
2024-08-04 14:59:57 +02:00
Kawe Mazidjatari
d298ad0c22 Client: initial rebuild of the curve look function
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.
2024-08-04 14:12:15 +02:00
Kawe Mazidjatari
06ea5773d7 Game: rename header file for consistency
C_Player is not a base class.
2024-08-03 15:18:44 +02:00
Kawe Mazidjatari
6715c25b37 Client: add reversed C_WeaponX class
Partially reversed.
2024-08-03 14:21:11 +02:00
Kawe Mazidjatari
5223ac8631 RTech: refactor playlists reloading/caching
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.
2024-08-03 12:06:42 +02:00
Kawe Mazidjatari
1e667c8f30 Engine: use CThreadMutex for installed maps global
Use the type used by the engine instead of STD.
2024-08-03 11:03:39 +02:00
Kawe Mazidjatari
90aa3a7bde Game: fix compile error
Invalid EHandles are always -1. INVALID_EHANDLE tag has been removed in commit 084f94aefd23e250f30f700acbe7cce343d78b75.
2024-07-31 22:39:44 +02:00
Kawe Mazidjatari
044528b9b1 Game: properly load shared global vars for game dll's
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.
2024-07-31 22:18:33 +02:00
Kawe Mazidjatari
084f94aefd Game: properly implement entity list base classes
Properly implemented and now mostly useable in the SDK.
2024-07-31 20:49:19 +02:00
Kawe Mazidjatari
892f415425 Server: reverse server entity list class
Fully reversed.
2024-07-31 17:44:30 +02:00
Kawe Mazidjatari
06ca0479b8 Client: get actual client entity list object 2024-07-31 15:28:29 +02:00
Kawe Mazidjatari
e41366f065 Client: reverse client entity list class
Fully reversed.
2024-07-31 15:06:54 +02:00
Kawe Mazidjatari
759a41bb69 Game: add CWeaponX class
Server side weapon entity.
2024-07-30 16:24:57 +02:00
Kawe Mazidjatari
f2070b6743 Server: fix incorrectly placed entity handle field
Datamap and assembly confirmed this field should be at 0x6bf4. The other nearby fields align properly now as well.
2024-07-30 15:09:44 +02:00
Kawe Mazidjatari
ac66fb513b Game: correctly type datamap fields 2024-07-30 15:04:41 +02:00
Kawe Mazidjatari
65253b4f44 UserCmd: clamp ucmd's on the client as well
Prevent server -> client attacks, may one ever be found again after the server-side UserCmd exploit fix.
2024-07-30 12:24:09 +02:00
Kawe Mazidjatari
3c68b491e7 UserCmd: use the preferred clamp function
Tends to get optimized better.
2024-07-30 12:08:34 +02:00
Kawe Mazidjatari
0ddd042d42 Game: force all data classes with virtual function tables to an 8 byte boundary
This is required as otherwise arrays will be out of alignment, e.g. CPlayer::m_playerKnockBacks was off with 4 bytes on the next array element as it was aligned to a 4 byte boundary while it contains a virtual function table pointer.
2024-07-30 10:18:04 +02:00
Kawe Mazidjatari
865e186703 Server: log NavMesh query init failures on hotswap 2024-07-30 02:13:43 +02:00
Kawe Mazidjatari
5428e1914f Game: fix circular include
The types needed for the typedef were already forward declared, no need to include additional headers here.
2024-07-30 01:50:56 +02:00
Kawe Mazidjatari
a9c6a5e733 Game: properly setup interface classes
Member m_RefEHandle is always at offset 8 for Server and Client BaseEntity class. The onyl way to achieve this is to put this into the IHandleEntity interface, as otherwise it will be placed after the interface pointers in C_BaseEntity for client. This also eliminates the need of padding at the beginning of both the server and client's version of the BaseEntity class. The IClientEntity interface has also been properly reversed and applied to the SDK now, the unknown vftable entries have now been identified correctly and moved to IClientUnknown .
2024-07-30 01:12:35 +02:00
Kawe Mazidjatari
f6bb588ef4 Client: remove duplicate class definiton
It was moved to shared game code.
2024-07-30 01:09:23 +02:00
Kawe Mazidjatari
7eb6017c16 Core: update copyright notice headers
Fix corrupted copyright symbol.
2024-07-29 21:09:55 +02:00
Kawe Mazidjatari
e8cefb64c3 Client: add client-side base entity classes
Some shared data that was misplaced in server headers have been moved to shared.
2024-07-29 21:01:26 +02:00
Kawe Mazidjatari
8c3daa4fe6 Client: add ALC per-optic scalar helper functions and cvars 2024-07-29 19:23:33 +02:00
Kawe Mazidjatari
1be76bd0c4 InputSystem: add reverse engineered CInput class
Reverse engineered classes that will be required to implement per-optic ALC scalars in-game.
2024-07-29 19:22:00 +02:00
Kawe Mazidjatari
f694269072 Server: properly implement NavMesh hotswap
The hotswap feature is now fully functional and no longer crashes the game. The NavMesh query states had to be reset.
2024-07-29 12:32:49 +02:00
Kawe Mazidjatari
fb1d1ba2e2 Server: add several getters and setters for AI classes 2024-07-29 12:17:09 +02:00
Kawe Mazidjatari
30185cbc59 Server: add AI manager class and pointer to SDK
Allows going over each AI from within the SDK.
2024-07-29 11:32:25 +02:00
Kawe Mazidjatari
824536f7b4 Server: add CAI_ScheduleBits and apply to class members 2024-07-29 10:28:51 +02:00
Kawe Mazidjatari
816589d872 Server: set correct enum types for AI class members 2024-07-29 10:23:08 +02:00
Kawe Mazidjatari
f9e115c610 Server: update navigation types 2024-07-29 10:22:09 +02:00
Kawe Mazidjatari
5c4a66f5b5 Server: add AI task debug code
Reimplement CAI_BaseNPC::TaskFail.
2024-07-28 22:36:05 +02:00
Kawe Mazidjatari
47aee3125d Server: add reverse engineered BaseNPC (AI) classes
Will be used for debug code and proper navmesh hotswaps.
2024-07-28 16:42:04 +02:00
Amos
50d3e1dc32 Game: fix compile error
Caused by making dtNavMesh fields private.
2024-07-24 10:24:58 +02:00