forked from Mirrorlandia_minetest/minetest
This enforces the fog_distance (if set) at the server, so that a hacked client could not cheat and retrieve blocks beyond the set distance.
This commit is contained in:
parent
26453df2f7
commit
869df17ddf
@ -180,7 +180,12 @@ void RemoteClient::GetNextBlocks (
|
||||
s32 new_nearest_unsent_d = -1;
|
||||
|
||||
// Get view range and camera fov (radians) from the client
|
||||
s16 fog_distance = sao->getPlayer()->getSkyParams().fog_distance;
|
||||
s16 wanted_range = sao->getWantedRange() + 1;
|
||||
if (fog_distance >= 0) {
|
||||
// enforce if limited by mod
|
||||
wanted_range = std::min<unsigned>(wanted_range, std::ceil((float)fog_distance / MAP_BLOCKSIZE));
|
||||
}
|
||||
float camera_fov = sao->getFov();
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user