Revert "antihacks: Patch fast/teleport vulnerability when attached to an entity"
* This reverts commit d32f4b368c40363e4e154451631559a6f2db9877. cos that old 0.,4 dont have the need structure of getParent()
This commit is contained in:
parent
d32f4b368c
commit
a17cd991b4
@ -1370,35 +1370,12 @@ std::string PlayerSAO::getPropertyPacket()
|
|||||||
|
|
||||||
bool PlayerSAO::checkMovementCheat()
|
bool PlayerSAO::checkMovementCheat()
|
||||||
{
|
{
|
||||||
if (m_is_singleplayer ||
|
if (isAttached() || m_is_singleplayer ||
|
||||||
g_settings->getBool("disable_anticheat")) {
|
g_settings->getBool("disable_anticheat")) {
|
||||||
m_last_good_position = m_base_position;
|
m_last_good_position = m_base_position;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (UnitSAO *parent = dynamic_cast<UnitSAO *>(getParent())) {
|
|
||||||
v3f attachment_pos;
|
|
||||||
{
|
|
||||||
int parent_id;
|
|
||||||
std::string bone;
|
|
||||||
v3f attachment_rot;
|
|
||||||
getAttachment(&parent_id, &bone, &attachment_pos, &attachment_rot);
|
|
||||||
}
|
|
||||||
|
|
||||||
v3f parent_pos = parent->getBasePosition();
|
|
||||||
f32 diff = m_base_position.getDistanceFromSQ(parent_pos) - attachment_pos.getLengthSQ();
|
|
||||||
const f32 maxdiff = 4.0f * BS; // fair trade-off value for various latencies
|
|
||||||
|
|
||||||
if ( (diff > maxdiff * maxdiff) /*&& m_privs.count("fast") != 0*/) {
|
|
||||||
setBasePosition(parent_pos);
|
|
||||||
actionstream << "Server: " << m_player->getName()
|
|
||||||
<< " moved away from parent; diff=" << sqrtf(diff) / BS
|
|
||||||
<< " resetting position." << std::endl;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
// Player movement is locked to the entity. Skip further checks
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
bool cheated = false;
|
bool cheated = false;
|
||||||
/*
|
/*
|
||||||
Check player movements
|
Check player movements
|
||||||
|
Loading…
x
Reference in New Issue
Block a user