Skip to content

Commit

Permalink
Formspec verification: Fix show_formspec inside callbacks (#7374)
Browse files Browse the repository at this point in the history
  • Loading branch information
SmallJoker committed May 26, 2018
1 parent 5c1edc5 commit bb4f0fd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/network/serverpackethandler.cpp
Expand Up @@ -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()
Expand Down

0 comments on commit bb4f0fd

Please sign in to comment.