mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-22 04:15:44 +02:00
Separate anticheat settings (#15040)
This commit is contained in:
@@ -646,9 +646,12 @@ void PlayerSAO::setMaxSpeedOverride(const v3f &vel)
|
||||
|
||||
bool PlayerSAO::checkMovementCheat()
|
||||
{
|
||||
static thread_local const u32 anticheat_flags =
|
||||
g_settings->getFlagStr("anticheat_flags", flagdesc_anticheat, nullptr);
|
||||
|
||||
if (m_is_singleplayer ||
|
||||
isAttached() ||
|
||||
g_settings->getBool("disable_anticheat")) {
|
||||
!(anticheat_flags & AC_MOVEMENT)) {
|
||||
m_last_good_position = m_base_position;
|
||||
return false;
|
||||
}
|
||||
@@ -729,6 +732,11 @@ bool PlayerSAO::checkMovementCheat()
|
||||
required_time = MYMAX(required_time, d_vert / s);
|
||||
}
|
||||
|
||||
static thread_local float anticheat_movement_tolerance =
|
||||
std::max(g_settings->getFloat("anticheat_movement_tolerance"), 1.0f);
|
||||
|
||||
required_time /= anticheat_movement_tolerance;
|
||||
|
||||
if (m_move_pool.grab(required_time)) {
|
||||
m_last_good_position = m_base_position;
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user