Skip to content

Commit

Permalink
Formspecs: Remove accidental empty 'quit' field
Browse files Browse the repository at this point in the history
  • Loading branch information
SmallJoker committed Jul 10, 2018
1 parent 0cf3645 commit f7a8e75
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/network/serverpackethandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1511,7 +1511,8 @@ 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) {
if (fields["quit"] == "true")
auto it = fields.find("quit");
if (it != fields.end() && it->second == "true")
m_formspec_state_data.erase(peer_state_iterator);

m_script->on_playerReceiveFields(playersao, client_formspec_name, fields);
Expand Down

0 comments on commit f7a8e75

Please sign in to comment.