summaryrefslogtreecommitdiff
path: root/src/nodedef.h
diff options
context:
space:
mode:
authorBeha <shacknetisp@mail.com>2019-08-12 13:18:52 -0400
committersfan5 <sfan5@live.de>2019-08-12 19:18:52 +0200
commit2f879e8bbd8329e4c796dc1f7eeea9bdc3be2b3d (patch)
treeddccb9eccf10cb14cec8a16ee745273bbf4d24f6 /src/nodedef.h
parent91114b562fb2c65467485008b810836f951274ea (diff)
downloadminetest-2f879e8bbd8329e4c796dc1f7eeea9bdc3be2b3d.tar.gz
minetest-2f879e8bbd8329e4c796dc1f7eeea9bdc3be2b3d.tar.bz2
minetest-2f879e8bbd8329e4c796dc1f7eeea9bdc3be2b3d.zip
Clear old item groups when they are overridden. (#8753)
This fixes overridden items keeping their old groups in the group to items mapping even after their groups have been changed in lua. It also prevents a more widespread issue where overriding an item will add its content ID *twice* to the mapping, resulting in odd behaviour in features such as ABMs.
Diffstat (limited to 'src/nodedef.h')
-rw-r--r--src/nodedef.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/nodedef.h b/src/nodedef.h
index 60d91f8d9..1a12aae93 100644
--- a/src/nodedef.h
+++ b/src/nodedef.h
@@ -669,6 +669,14 @@ private:
void addNameIdMapping(content_t i, std::string name);
/*!
+ * Removes a content ID from all groups.
+ * Erases content IDs from vectors in \ref m_group_to_items and
+ * removes empty vectors.
+ * @param id Content ID
+ */
+ void eraseIdFromGroups(content_t id);
+
+ /*!
* Recalculates m_selection_box_int_union based on
* m_selection_box_union.
*/