From f4a01f3a5dc0d8fe2f4f6d804d790da91d1bc30c Mon Sep 17 00:00:00 2001 From: Jude Melton-Houghton Date: Mon, 26 Sep 2022 17:03:43 -0400 Subject: Avoid duplication of mod metadata in memory (#12562) Co-authored-by: sfan5 --- src/script/lua_api/l_nodemeta.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/script/lua_api/l_nodemeta.h') diff --git a/src/script/lua_api/l_nodemeta.h b/src/script/lua_api/l_nodemeta.h index 265ece3d0..40df9438d 100644 --- a/src/script/lua_api/l_nodemeta.h +++ b/src/script/lua_api/l_nodemeta.h @@ -38,7 +38,7 @@ private: v3s16 m_p; ServerEnvironment *m_env = nullptr; // Set for client metadata - Metadata *m_local_meta = nullptr; + IMetadata *m_local_meta = nullptr; static const char className[]; static const luaL_Reg methodsServer[]; @@ -59,13 +59,13 @@ private: * @param auto_create when true, try to create metadata information for the node if it has none. * @return pointer to a @c NodeMetadata object or @c NULL in case of error. */ - virtual Metadata* getmeta(bool auto_create); + virtual IMetadata* getmeta(bool auto_create); virtual void clearMeta(); virtual void reportMetadataChange(const std::string *name = nullptr); - virtual void handleToTable(lua_State *L, Metadata *_meta); - virtual bool handleFromTable(lua_State *L, int table, Metadata *_meta); + virtual void handleToTable(lua_State *L, IMetadata *_meta); + virtual bool handleFromTable(lua_State *L, int table, IMetadata *_meta); // Exported functions @@ -80,7 +80,7 @@ private: public: NodeMetaRef(v3s16 p, ServerEnvironment *env); - NodeMetaRef(Metadata *meta); + NodeMetaRef(IMetadata *meta); ~NodeMetaRef() = default; @@ -89,7 +89,7 @@ public: static void create(lua_State *L, v3s16 p, ServerEnvironment *env); // Client-sided version of the above - static void createClient(lua_State *L, Metadata *meta); + static void createClient(lua_State *L, IMetadata *meta); static void RegisterCommon(lua_State *L); static void Register(lua_State *L); -- cgit v1.2.3