From c2a3a62461dcc54d885b9e423cf2b358c5662795 Mon Sep 17 00:00:00 2001 From: darkrose Date: Sun, 4 Oct 2015 16:40:23 +1000 Subject: [PATCH] allow opening a form from the node next to the selected node, if onact_also_affects points to it --- src/game.cpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/game.cpp b/src/game.cpp index 0beae4b..237f9c8 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -1826,6 +1826,33 @@ void the_game( client.playSound(sound,0); } client.setFormState(true); + }else{ + MapNode nn = client.getNode(nodepos); + v3s16 aa = content_features(nn).onact_also_affects; + if (aa != v3s16(0,0,0)) { + v3s16 npos = nodepos+nn.getEffectedRotation(); + NodeMetadata *ameta = client.getNodeMetadata(npos); + if (ameta && ameta->getDrawSpecString(client.getLocalPlayer()) != "") { + infostream<<"Launching custom inventory view"<setFormSpec(ameta->getDrawSpecString(client.getLocalPlayer()), inventoryloc); + menu->setFormIO(new NodeMetadataFormIO(npos, &client)); + menu->drop(); + { + std::string sound = content_features(nn.getContent()).sound_access; + if (sound == "") + sound = "open-menu"; + client.playSound(sound,0); + } + client.setFormState(true); + } + } } } if (input->getRightClicked()) {