mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 08:35:20 +02:00
Make supplying empty formspec strings close the formspec (#4737)
This will only happen if the formname matches or if formname is "".
This commit is contained in:
@@ -1647,8 +1647,12 @@ void Server::SendShowFormspecMessage(u16 peer_id, const std::string &formspec,
|
||||
DSTACK(FUNCTION_NAME);
|
||||
|
||||
NetworkPacket pkt(TOCLIENT_SHOW_FORMSPEC, 0 , peer_id);
|
||||
|
||||
pkt.putLongString(FORMSPEC_VERSION_STRING + formspec);
|
||||
if (formspec == "" ){
|
||||
//the client should close the formspec
|
||||
pkt.putLongString("");
|
||||
} else {
|
||||
pkt.putLongString(FORMSPEC_VERSION_STRING + formspec);
|
||||
}
|
||||
pkt << formname;
|
||||
|
||||
Send(&pkt);
|
||||
|
Reference in New Issue
Block a user