diff --git a/src/gta/joaat.hpp b/src/gta/joaat.hpp index 7444599d..1a0b8a76 100644 --- a/src/gta/joaat.hpp +++ b/src/gta/joaat.hpp @@ -28,5 +28,23 @@ namespace rage static_assert(consteval_joaat("test") == 0x3f75ccc1); } +inline consteval rage::joaat_t operator""_j(const char* s, std::size_t n) +{ + rage::joaat_t result = 0; + + for (std::size_t i = 0; i < n; i++) + { + result += rage::joaat_to_lower(s[i]); + result += (result << 10); + result ^= (result >> 6); + } + + result += (result << 3); + result ^= (result >> 11); + result += (result << 15); + + return result; +} + #define RAGE_JOAAT_IMPL(str) (::rage::consteval_joaat(str)) #define RAGE_JOAAT(str) (std::integral_constant::value) \ No newline at end of file diff --git a/src/hooking.cpp b/src/hooking.cpp index 1973278d..e77e660c 100644 --- a/src/hooking.cpp +++ b/src/hooking.cpp @@ -56,7 +56,7 @@ namespace big detour_hook_helper::add("RCC", g_pointers->m_received_clone_create); detour_hook_helper::add("RCS", g_pointers->m_received_clone_sync); - // detour_hook_helper::add("CAD", g_pointers->m_can_apply_data); + detour_hook_helper::add("CAD", g_pointers->m_can_apply_data); detour_hook_helper::add("GNED", g_pointers->m_get_network_event_data); detour_hook_helper::add("WPGDN", g_pointers->m_write_player_gamer_data_node);