1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Refactor CSM restriction code a bit

This also fixes find_node_near restrictions being ineffective.
This commit is contained in:
sfan5 2019-11-08 22:57:03 +01:00
parent 4d668f32a6
commit b0260b5ec8
4 changed files with 27 additions and 32 deletions

View file

@ -261,14 +261,10 @@ public:
// Causes urgent mesh updates (unlike Map::add/removeNodeWithEvent)
void removeNode(v3s16 p);
/**
* Helper function for Client Side Modding
* CSM restrictions are applied there, this should not be used for core engine
* @param p
* @param is_valid_position
* @return
*/
MapNode getNode(v3s16 p, bool *is_valid_position);
// helpers to enforce CSM restrictions
MapNode CSMGetNode(v3s16 p, bool *is_valid_position);
int CSMClampRadius(v3s16 pos, int radius);
void addNode(v3s16 p, MapNode n, bool remove_metadata = true);
void setPlayerControl(PlayerControl &control);