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();