mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Implement client node dig prediction
Dig prediction allows clients to remove dug nodes without waiting for server acknowledgement. This patch allows mods to override dig prediction, it can either be turned off or a different "prediction node" can be selected.
This commit is contained in:
parent
d10cccee31
commit
5b3fbf9cf7
5 changed files with 33 additions and 1 deletions
|
@ -737,6 +737,10 @@ ContentFeatures read_content_features(lua_State *L, int index)
|
|||
}
|
||||
lua_pop(L, 1);
|
||||
|
||||
// Node immediately placed by client when node is dug
|
||||
getstringfield(L, index, "node_dig_prediction",
|
||||
f.node_dig_prediction);
|
||||
|
||||
return f;
|
||||
}
|
||||
|
||||
|
@ -861,6 +865,8 @@ void push_content_features(lua_State *L, const ContentFeatures &c)
|
|||
lua_setfield(L, -2, "legacy_facedir_simple");
|
||||
lua_pushboolean(L, c.legacy_wallmounted);
|
||||
lua_setfield(L, -2, "legacy_wallmounted");
|
||||
lua_pushstring(L, c.node_dig_prediction.c_str());
|
||||
lua_setfield(L, -2, "node_dig_prediction");
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue