diff options
author | Jude Melton-Houghton <jwmhjwmh@gmail.com> | 2022-09-26 17:03:43 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-26 17:03:43 -0400 |
commit | f4a01f3a5dc0d8fe2f4f6d804d790da91d1bc30c (patch) | |
tree | 089ddc309e22ae8549ec3b86765ee272f57a33df /src/script/lua_api/l_nodemeta.h | |
parent | 03428d9825cfdf2cfaed6ac9410dafccac0d4f3a (diff) | |
download | minetest-f4a01f3a5dc0d8fe2f4f6d804d790da91d1bc30c.tar.xz |
Avoid duplication of mod metadata in memory (#12562)
Co-authored-by: sfan5 <sfan5@live.de>
Diffstat (limited to 'src/script/lua_api/l_nodemeta.h')
-rw-r--r-- | src/script/lua_api/l_nodemeta.h | 12 |
1 files changed, 6 insertions, 6 deletions
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); |