1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-12 16:58:39 +00:00

Allow mods to listen to cheat detections using minetest.register_on_cheat()

This commit is contained in:
Perttu Ahola 2013-08-04 00:45:49 +03:00
parent 742614180c
commit 8831669505
7 changed files with 40 additions and 3 deletions

View file

@ -1454,8 +1454,9 @@ std::string PlayerSAO::getPropertyPacket()
return gob_cmd_set_properties(m_prop);
}
void PlayerSAO::checkMovementCheat()
bool PlayerSAO::checkMovementCheat()
{
bool cheated = false;
if(isAttached() || m_is_singleplayer ||
g_settings->getBool("disable_anticheat"))
{
@ -1503,8 +1504,10 @@ void PlayerSAO::checkMovementCheat()
<<std::endl;
m_player->setPosition(m_last_good_position);
m_moved = true;
cheated = true;
}
}
return cheated;
}
bool PlayerSAO::getCollisionBox(aabb3f *toset) {