diff options
author | sapier <Sapier at GMX dot net> | 2013-01-03 17:59:28 +0000 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2013-01-07 19:00:33 +0200 |
commit | 0b1d09ff4f4e92986f6abdbc57db97c18707196a (patch) | |
tree | 1ae8016123a1c031406653c924c6f32e1e24db43 /src/game.cpp | |
parent | 8b75736c6f747ec4d01419ee6475e03feab398b9 (diff) | |
download | minetest-0b1d09ff4f4e92986f6abdbc57db97c18707196a.tar.gz minetest-0b1d09ff4f4e92986f6abdbc57db97c18707196a.tar.bz2 minetest-0b1d09ff4f4e92986f6abdbc57db97c18707196a.zip |
Fix buttons not working for Lua-triggered formspecs
Diffstat (limited to 'src/game.cpp')
-rw-r--r-- | src/game.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/game.cpp b/src/game.cpp index ca992c056..c8f1d2187 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -118,13 +118,20 @@ struct TextDestPlayerInventory : public TextDest TextDestPlayerInventory(Client *client) { m_client = client; + m_formname = ""; + } + TextDestPlayerInventory(Client *client, std::string formname) + { + m_client = client; + m_formname = formname; } void gotText(std::map<std::string, std::string> fields) { - m_client->sendInventoryFields("", fields); + m_client->sendInventoryFields(m_formname, fields); } Client *m_client; + std::string m_formname; }; /* Respawn menu callback */ @@ -2154,6 +2161,7 @@ void the_game( &g_menumgr, &client, gamedef); menu->setFormSource(current_formspec); + menu->setTextDest(new TextDestPlayerInventory(&client,*(event.show_formspec.formname))); menu->drop(); } else @@ -2162,6 +2170,7 @@ void the_game( current_formspec->setForm(*(event.show_formspec.formspec)); } delete(event.show_formspec.formspec); + delete(event.show_formspec.formname); } else if(event.type == CE_TEXTURES_UPDATED) { |