From a5b2c28c3b2fb571685558e11dcaf05ba841e605 Mon Sep 17 00:00:00 2001 From: Quentin Date: Sun, 25 Jun 2023 23:04:01 +0200 Subject: [PATCH] fix(CanApply): issue with selecting the correct datanode (#1533) --- src/gta/joaat.hpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/gta/joaat.hpp b/src/gta/joaat.hpp index 42341fda..de774119 100644 --- a/src/gta/joaat.hpp +++ b/src/gta/joaat.hpp @@ -8,6 +8,25 @@ namespace rage { + template + inline constexpr joaat_t consteval_joaat(char const (&data)[N]) + { + joaat_t hash = 0; + + for (std::size_t i = 0; i < N - 1; ++i) + { + hash += joaat_to_lower(data[i]); + hash += (hash << 10); + hash ^= (hash >> 6); + } + + hash += (hash << 3); + hash ^= (hash >> 11); + hash += (hash << 15); + + return hash; + } + inline consteval joaat_t consteval_joaat(const std::span& data) { joaat_t hash = 0;