Minetest_game: Rotating wall torch with screwdriver may lead to "invalid" rotation

Created on 13 Dec 2019  路  13Comments  路  Source: minetest/minetest_game

Version: 5.1.0

Just place a torch at a wall somewhere and play around with the screwdriver a bit.

You might end up with the torch in an "invalid" position, that is, the wall torch is "attached" upwards or downwards. This can look very odd. I do not think this is intentional.

Note there's a separate node for upwards and downwards torches.

Bug

All 13 comments

~An invalid position seems ok to me, it does no harm. Many nodes can be rotated or positioned in non-realistic ways. Unless a 'fix' is very simple i do not think it is worth doing.
Thanks anyway.~

I can't seem to reproduce this in the latest version of Minetest?

Sorry, i may have misunderstood the first post. If you are suggesting that the screwdriver should not function at all on torches, i am fine with that. As far as i know that is very simply done, if so i will support a PR that does that.
Torches rotate on placement according to the surface they are placed on, so screwdriver rotation is not necessary.

I can't seem to reproduce this in the latest version of Minetest?

It is not possible to rotate the torch in a way that it will float afterwards., that's probably because of this function:
https://github.com/minetest/minetest_game/blob/10824667963a78f8f0d098b233ef2badff985f69/mods/screwdriver/init.lua#L20-L31
Torches currently don't have an on_rotate field in their def.

Ok it is possible to cause a strange result. With the structure below a wall torch can become a wall torch placed on a horizontal surface, and back again, when right-clicking screwdriver:

screenshot_20200209_233135

screenshot_20200209_233143

Note the flame pointing in the wrong direction.

With the structure below a ceiling torch can become a ceiling torch placed on a vertical surface, and back again, when right-clicking screwdriver:

screenshot_20200209_233659

screenshot_20200209_233710

Note the flame pointing in the wrong direction.

Both of those issues were solved by the first commit in my PR; by using on_rotate and param2 to determine the correct torch placement.

More weirdness can occur.
Generally, a torch in any 2 or 3 node corner can be rotated into invalid rotations using screwdriver left or right click.

Yeah, that was all fixed in my PR in the first commit.

Yes i know =)

Hah sorry; I spent a good hour fiddling around with the code to write the on_rotate function correctly, and for all of it to end up as three false statements; I already did that at the beginning, so one can probably imagine how I feel xD

Well, i did make clear what implementation i prefer, see https://github.com/minetest/minetest_game/issues/2545#issuecomment-569465568 above:

If you are suggesting that the screwdriver should not function at all on torches, i am fine with that. As far as i know that is very simply done, if so i will support a PR that does that.
Torches rotate on placement according to the surface they are placed on, so screwdriver rotation is not necessary.

My fault; I didn't read that comment fully.
Anyway, since torches are dig_immediate too, it makes sense why rotation using a screwdriver isn't really required. I thought of keeping it since most nodes can be rotated.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Desour picture Desour  路  6Comments

benrob0329 picture benrob0329  路  4Comments

MarkuBu picture MarkuBu  路  5Comments

paramat picture paramat  路  3Comments

stujones11 picture stujones11  路  4Comments