From ceeea0bd51631ed58f3a78aa1c405b1a730cf233 Mon Sep 17 00:00:00 2001 From: altalk23 <45172705+altalk23@users.noreply.github.com> Date: Thu, 2 Mar 2023 01:08:25 +0300 Subject: [PATCH] Make the field fix only a minor change --- loader/include/Geode/modify/Field.hpp | 2 ++ loader/src/hooks/GeodeNodeMetadata.cpp | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/loader/include/Geode/modify/Field.hpp b/loader/include/Geode/modify/Field.hpp index adf88321..0b503f4f 100644 --- a/loader/include/Geode/modify/Field.hpp +++ b/loader/include/Geode/modify/Field.hpp @@ -49,6 +49,8 @@ namespace geode::modifier { } }; + [[deprecated("Will be removed in 1.0.0")]] + GEODE_DLL size_t getFieldIndexForClass(size_t hash); GEODE_DLL size_t getFieldIndexForClass(char const* name); template diff --git a/loader/src/hooks/GeodeNodeMetadata.cpp b/loader/src/hooks/GeodeNodeMetadata.cpp index 4abf24f5..8efc1818 100644 --- a/loader/src/hooks/GeodeNodeMetadata.cpp +++ b/loader/src/hooks/GeodeNodeMetadata.cpp @@ -84,6 +84,10 @@ size_t modifier::getFieldIndexForClass(char const* name) { return s_nextIndex[name]++; } +size_t modifier::getFieldIndexForClass(size_t hash) { + return s_nextIndex[std::string(hash)]++; +} + // not const because might modify contents FieldContainer* CCNode::getFieldContainer() { return GeodeNodeMetadata::set(this)->getFieldContainer();