mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-22 17:18:39 +00:00
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.
This commit is contained in:
parent
91114b562f
commit
2f879e8bbd
2 changed files with 36 additions and 14 deletions
|
@ -668,6 +668,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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue