mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-27 17:28:41 +00:00
Separate anticheat settings (#15040)
This commit is contained in:
parent
d2b4c27f21
commit
1b2d24791a
6 changed files with 47 additions and 8 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue