mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Only fly through walls in noclip mode wich requires the noclip privilege
This commit is contained in:
parent
1d13d106dd
commit
52ba413185
5 changed files with 31 additions and 3 deletions
|
@ -73,9 +73,11 @@ void LocalPlayer::move(f32 dtime, Map &map, f32 pos_max_d,
|
|||
return;
|
||||
}
|
||||
|
||||
// Skip collision detection if a special movement mode is used
|
||||
// Skip collision detection if noclip mode is used
|
||||
bool fly_allowed = m_gamedef->checkLocalPrivilege("fly");
|
||||
bool free_move = fly_allowed && g_settings->getBool("free_move");
|
||||
bool noclip = m_gamedef->checkLocalPrivilege("noclip") &&
|
||||
g_settings->getBool("noclip");
|
||||
bool free_move = noclip && fly_allowed && g_settings->getBool("free_move");
|
||||
if(free_move)
|
||||
{
|
||||
position += m_speed * dtime;
|
||||
|
@ -300,7 +302,8 @@ void LocalPlayer::move(f32 dtime, Map &map, f32 pos_max_d,
|
|||
Report collisions
|
||||
*/
|
||||
bool bouncy_jump = false;
|
||||
if(collision_info)
|
||||
// Dont report if flying
|
||||
if(collision_info && !g_settings->getBool("free_move"))
|
||||
{
|
||||
for(size_t i=0; i<result.collisions.size(); i++){
|
||||
const CollisionInfo &info = result.collisions[i];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue