1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00: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:
HybridDog 2019-03-07 08:31:25 +01:00 committed by Loïc Blot
parent 3066d76e33
commit 431d8a9b83
4 changed files with 13 additions and 21 deletions

View file

@ -145,11 +145,6 @@ struct MapNode
param2(a_param2)
{ }
// Create directly from a nodename
// If name is unknown, sets CONTENT_IGNORE
MapNode(const NodeDefManager *ndef, const std::string &name,
u8 a_param1=0, u8 a_param2=0);
bool operator==(const MapNode &other) const noexcept
{
return (param0 == other.param0