mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 16:45:20 +02: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:
@@ -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");
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
|
Reference in New Issue
Block a user