mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 00:25:19 +02:00
Abort when trying to set a not registered node (#7011)
I removed the MapNode constructor which takes a nodename and gives the node's id or CONTENT_IGNORE The code which used this constructor (two places) now handles the situation of not registered nodes correctly: * minetest.set_node and similar functions make minetest crash when a not registered node is passed * reverting a node with rollback aborts if the node is not registered
This commit is contained in:
@@ -44,18 +44,6 @@ static const u8 rot_to_wallmounted[] = {
|
||||
MapNode
|
||||
*/
|
||||
|
||||
// Create directly from a nodename
|
||||
// If name is unknown, sets CONTENT_IGNORE
|
||||
MapNode::MapNode(const NodeDefManager *ndef, const std::string &name,
|
||||
u8 a_param1, u8 a_param2)
|
||||
{
|
||||
content_t id = CONTENT_IGNORE;
|
||||
ndef->getId(name, id);
|
||||
param0 = id;
|
||||
param1 = a_param1;
|
||||
param2 = a_param2;
|
||||
}
|
||||
|
||||
void MapNode::getColor(const ContentFeatures &f, video::SColor *color) const
|
||||
{
|
||||
if (f.palette) {
|
||||
|
Reference in New Issue
Block a user