New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Locked chests aren't protected against explosions #1885

Closed
danielmeek32 opened this Issue Sep 2, 2017 · 7 comments

Comments

Projects
None yet
4 participants
@danielmeek32
Contributor

danielmeek32 commented Sep 2, 2017

Since commit 011ad78 locked chests are affected by explosions just as with regular chests, dropping their contents. (Furthermore, the chest itself is dropped as a normal chest rather than a locked chest.)

I suspect that this is a bug.

@Fixer-007

This comment has been minimized.

Contributor

Fixer-007 commented Sep 2, 2017

I thought that was a feature...

@jastevenson303

This comment has been minimized.

Contributor

jastevenson303 commented Sep 2, 2017

The locked chest dropping as a normal chest (?) sounds like a bug, but the TNT explosion itself is the one that checks for protected nodes. I typically equate locked doors and chests, so I have to ask: Do the steel doors also explode normally? (And now I'm wondering about bones.)

TNT exploding a chest, locked chest, bookshelf, or vessel shelf, will drop the node, and its contents, by design.

@danielmeek32

This comment has been minimized.

Contributor

danielmeek32 commented Sep 2, 2017

@Fixer-007

The Minetest wiki page on Locked Chests states that a locked chest will survive explosions. This was the behaviour before 011ad78.

@jastevenson303

I can confirm that locked doors are not removed in an explosion. Also the locked chest was not removed before 011ad78. Looking at 011ad78, line 1892 defines an empty on_blast callback for locked chests but this is overridden with the callback that was previously used for ordinary chests on line 1976. It appears that the callback was copied and pasted from the old code into the wrong place (note that in the old code it appeared directly after on_metadata_inventory_take as is the case here).

@jastevenson303

This comment has been minimized.

Contributor

jastevenson303 commented Sep 2, 2017

Regardless of previous behavior, how it stands now is inconsistent with locked doors and bones, both fresh and old. Bones and Steel Doors simply don't explode, while Locked Chests do.
https://www.twitch.tv/videos/171715042
And that's in an unprotected area. (Not to be confused with 'protected' chests, which in this case means locked). I'll test some more with protected areas and other users.

I remember blowing up player's bones with TNT. That was nice.

@danielmeek32

This comment has been minimized.

Contributor

danielmeek32 commented Sep 2, 2017

@jastevenson303 The point is that the behaviour has changed and was not intended to change (at least not as far as I can tell). Judging from the code introduced in 011ad78, it definitely appears to be an error as on_blast is assigned an empty callback to protect against explosions and then overridden later on with the callback that's intended to be applied to non-locked chests.

@jastevenson303

This comment has been minimized.

Contributor

jastevenson303 commented Sep 3, 2017

Chests and shelves blowing up and dropping their contents was added as a feature. Are you saying that before 011ad78, only regular chests blew and not locked ones?

I agree locked chests should not blow up, as to match the behavior of steel doors (and bones). However, I actually wouldn't mind being able to blow up old, expired bones. And I can imagine blowing up the chest as a design choice, too. Let's ask @sofar

@danielmeek32

This comment has been minimized.

Contributor

danielmeek32 commented Sep 3, 2017

@jastevenson303 Yes, before 011ad78 locked chests could not be blown up, only regular chests. I believe that this is the intended behaviour according to the wiki.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment