mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-11 17:51:04 +00:00
Dehardcode the death formspec (#15155)
Co-authored-by: Paul Ouellette <oue.paul18@gmail.com>
This commit is contained in:
parent
3c48671076
commit
526a2f7b8c
79 changed files with 242 additions and 172 deletions
|
@ -858,33 +858,6 @@ void Server::handleCommand_PlayerItem(NetworkPacket* pkt)
|
|||
playersao->getPlayer()->setWieldIndex(item);
|
||||
}
|
||||
|
||||
void Server::handleCommand_Respawn(NetworkPacket* pkt)
|
||||
{
|
||||
session_t peer_id = pkt->getPeerId();
|
||||
RemotePlayer *player = m_env->getPlayer(peer_id);
|
||||
if (player == NULL) {
|
||||
errorstream <<
|
||||
"Server::ProcessData(): Canceling: No player for peer_id=" <<
|
||||
peer_id << " disconnecting peer!" << std::endl;
|
||||
DisconnectPeer(peer_id);
|
||||
return;
|
||||
}
|
||||
|
||||
PlayerSAO *playersao = player->getPlayerSAO();
|
||||
assert(playersao);
|
||||
|
||||
if (!playersao->isDead())
|
||||
return;
|
||||
|
||||
RespawnPlayer(peer_id);
|
||||
|
||||
actionstream << player->getName() << " respawns at "
|
||||
<< (playersao->getBasePosition() / BS) << std::endl;
|
||||
|
||||
// ActiveObject is added to environment in AsyncRunStep after
|
||||
// the previous addition has been successfully removed
|
||||
}
|
||||
|
||||
bool Server::checkInteractDistance(RemotePlayer *player, const f32 d, const std::string &what)
|
||||
{
|
||||
ItemStack selected_item, hand_item;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue