Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
lua_api.txt: Document how to properly clear node metadata
- Loading branch information
573b50a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mtango688 in my experience meta:to_table() never returns nil
What is the meaning of clear metadata?
573b50a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you know what a node is?
In Minetest, you obtain a reference to a node, and then you can perform several methods, one of which is "get_meta(pos)". From that, you can obtain a reference to extra data and functionality (called NodeMetaData). The above commit simply documents how to reset that data.
573b50a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you reset the metadata and then get the table using
to_table()
, it's notnil
but{fields={}, inventory={}}
, so l updated the WorldEdit save function.HybridDog/WorldEdit-pack@46518c3#diff-47530146b5061f78ea9bf09cf9e200a3R163
In which case does
to_table()
returnnil
?And does
from_table{}
also reset it?