From bb4f0fd2285de8b8fd578706dd5287ee1dbb9b93 Mon Sep 17 00:00:00 2001 From: SmallJoker Date: Sat, 26 May 2018 12:50:44 +0200 Subject: Formspec verification: Fix show_formspec inside callbacks (#7374) --- src/network/serverpackethandler.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/network') diff --git a/src/network/serverpackethandler.cpp b/src/network/serverpackethandler.cpp index 2d810836b..c961d406e 100644 --- a/src/network/serverpackethandler.cpp +++ b/src/network/serverpackethandler.cpp @@ -1514,9 +1514,10 @@ void Server::handleCommand_InventoryFields(NetworkPacket* pkt) if (peer_state_iterator != m_formspec_state_data.end()) { const std::string &server_formspec_name = peer_state_iterator->second; if (client_formspec_name == server_formspec_name) { - m_script->on_playerReceiveFields(playersao, client_formspec_name, fields); if (fields["quit"] == "true") m_formspec_state_data.erase(peer_state_iterator); + + m_script->on_playerReceiveFields(playersao, client_formspec_name, fields); return; } actionstream << "'" << player->getName() -- cgit v1.2.3