Skip to content

Commit

Permalink
Use swapNode for set_node_level and add_node_level
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sfan5 committed Jun 23, 2023
1 parent 6262993 commit 610578e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/script/lua_api/l_env.cpp
Expand Up @@ -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;
}

Expand All @@ -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;
}

Expand Down

0 comments on commit 610578e

Please sign in to comment.