diff options
author | Vitaliy <numzer0@yandex.ru> | 2020-05-21 00:52:10 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-20 22:52:10 +0100 |
commit | 82e41378937378667cdbdda3ea9e8c1acb5822ea (patch) | |
tree | 07a5e04b6979b42e763640b8dccec6e7c8855854 /src/nodedef.h | |
parent | 42fcfb75e85523a2fa5d99a453c2fabc2c04c0f6 (diff) | |
download | hax-minetest-server-82e41378937378667cdbdda3ea9e8c1acb5822ea.tar.gz hax-minetest-server-82e41378937378667cdbdda3ea9e8c1acb5822ea.zip |
Cache liquid alternative IDs (#8053)
Diffstat (limited to 'src/nodedef.h')
-rw-r--r-- | src/nodedef.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/nodedef.h b/src/nodedef.h index 497e7ee0e..0992001e1 100644 --- a/src/nodedef.h +++ b/src/nodedef.h @@ -368,8 +368,10 @@ struct ContentFeatures enum LiquidType liquid_type; // If the content is liquid, this is the flowing version of the liquid. std::string liquid_alternative_flowing; + content_t liquid_alternative_flowing_id; // If the content is liquid, this is the source version of the liquid. std::string liquid_alternative_source; + content_t liquid_alternative_source_id; // Viscosity for fluid flow, ranging from 1 to 7, with // 1 giving almost instantaneous propagation and 7 being // the slowest possible @@ -428,7 +430,7 @@ struct ContentFeatures } bool sameLiquid(const ContentFeatures &f) const{ if(!isLiquid() || !f.isLiquid()) return false; - return (liquid_alternative_flowing == f.liquid_alternative_flowing); + return (liquid_alternative_flowing_id == f.liquid_alternative_flowing_id); } int getGroup(const std::string &group) const @@ -641,10 +643,11 @@ public: void resetNodeResolveState(); /*! - * Resolves the IDs to which connecting nodes connect from names. + * Resolves (caches the IDs) cross-references between nodes, + * like liquid alternatives. * Must be called after node registration has finished! */ - void mapNodeboxConnections(); + void resolveCrossrefs(); private: /*! |