mirror of
https://github.com/minetest/minetest.git
synced 2025-03-06 20:48:40 +01:00
Use swapNode for set_node_level and add_node_level
While this is a behaviour change I don't think the old one made any sense. It's possible that someone hit this before and wrote a workaround for it, they won't be affected by this change. It only makes things work that didn't before.
This commit is contained in:
parent
62629939ff
commit
610578e3e2
1 changed files with 2 additions and 2 deletions
|
@ -541,7 +541,7 @@ int ModApiEnvMod::l_set_node_level(lua_State *L)
|
|||
level = lua_tonumber(L, 2);
|
||||
MapNode n = env->getMap().getNode(pos);
|
||||
lua_pushnumber(L, n.setLevel(env->getGameDef()->ndef(), level));
|
||||
env->setNode(pos, n);
|
||||
env->swapNode(pos, n);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -558,7 +558,7 @@ int ModApiEnvMod::l_add_node_level(lua_State *L)
|
|||
level = lua_tonumber(L, 2);
|
||||
MapNode n = env->getMap().getNode(pos);
|
||||
lua_pushnumber(L, n.addLevel(env->getGameDef()->ndef(), level));
|
||||
env->setNode(pos, n);
|
||||
env->swapNode(pos, n);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue