1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-11 17:51:04 +00:00

Various anticheat improvements

* Calculate maximum interact distance from wielded tool
* New "interacted_while_dead" cheat_type for the Lua API
* Disallow dropping items while dead
* Move player to spawn before resurrecting them
This commit is contained in:
sfan5 2016-12-22 19:29:15 +01:00
parent b95f543da9
commit b16252dcae
3 changed files with 61 additions and 40 deletions

View file

@ -2557,15 +2557,15 @@ void Server::RespawnPlayer(u16 peer_id)
playersao->setHP(PLAYER_MAX_HP);
playersao->setBreath(PLAYER_MAX_BREATH);
SendPlayerHP(peer_id);
SendPlayerBreath(peer_id);
bool repositioned = m_script->on_respawnplayer(playersao);
if(!repositioned){
if (!repositioned) {
v3f pos = findSpawnPos();
// setPos will send the new position to client
playersao->setPos(pos);
}
SendPlayerHP(peer_id);
SendPlayerBreath(peer_id);
}