Merge branch 'master' into new

This commit is contained in:
Maksim Gamarnik 2017-03-11 21:52:53 +02:00 committed by GitHub
commit 346c893475
1 changed files with 6 additions and 2 deletions

View File

@ -4112,7 +4112,11 @@ void Game::handlePointingAtObject(GameRunData *runData,
runData->selected_object->debugInfoText()));
}
if (isLeftPressed()) {
const ItemDefinition &playeritem_def =
playeritem.getDefinition(itemdef_manager);
bool nohit_enabled = ((ItemGroupList) playeritem_def.groups)["attached_node"] != 0;
if (input->getLeftState() && !nohit_enabled) {
bool do_punch = false;
bool do_punch_damage = false;
@ -4142,7 +4146,7 @@ void Game::handlePointingAtObject(GameRunData *runData,
if (!disable_send)
client->interact(0, pointed);
}
} else if (getRightClicked()) {
} else if (input->getRightClicked() || (input->getLeftClicked() && nohit_enabled)) {
infostream << "Right-clicked object" << std::endl;
client->interact(3, pointed); // place
}