mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-15 17:35:37 +02:00
Dehardcode the death formspec (#15155)
Co-authored-by: Paul Ouellette <oue.paul18@gmail.com>
This commit is contained in:
@@ -157,13 +157,6 @@ int ModApiClient::l_show_formspec(lua_State *L)
|
||||
return 1;
|
||||
}
|
||||
|
||||
// send_respawn()
|
||||
int ModApiClient::l_send_respawn(lua_State *L)
|
||||
{
|
||||
getClient(L)->sendRespawn();
|
||||
return 0;
|
||||
}
|
||||
|
||||
// disconnect()
|
||||
int ModApiClient::l_disconnect(lua_State *L)
|
||||
{
|
||||
@@ -348,7 +341,6 @@ void ModApiClient::Initialize(lua_State *L, int top)
|
||||
API_FCT(clear_out_chat_queue);
|
||||
API_FCT(get_player_names);
|
||||
API_FCT(show_formspec);
|
||||
API_FCT(send_respawn);
|
||||
API_FCT(gettext);
|
||||
API_FCT(get_node_or_nil);
|
||||
API_FCT(disconnect);
|
||||
|
@@ -51,9 +51,6 @@ private:
|
||||
// show_formspec(name, formspec)
|
||||
static int l_show_formspec(lua_State *L);
|
||||
|
||||
// send_respawn()
|
||||
static int l_send_respawn(lua_State *L);
|
||||
|
||||
// disconnect()
|
||||
static int l_disconnect(lua_State *L);
|
||||
|
||||
|
@@ -2693,11 +2693,11 @@ int ObjectRef::l_respawn(lua_State *L)
|
||||
{
|
||||
NO_MAP_LOCK_REQUIRED;
|
||||
ObjectRef *ref = checkObject<ObjectRef>(L, 1);
|
||||
RemotePlayer *player = getplayer(ref);
|
||||
if (player == nullptr)
|
||||
auto *psao = getplayersao(ref);
|
||||
if (psao == nullptr)
|
||||
return 0;
|
||||
|
||||
getServer(L)->RespawnPlayer(player->getPeerId());
|
||||
psao->respawn();
|
||||
lua_pushboolean(L, true);
|
||||
return 1;
|
||||
}
|
||||
|
Reference in New Issue
Block a user