Skip to content
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

tnt.boom: lack of central on_blast call #1825

Closed
Desour opened this issue Jul 9, 2017 · 5 comments
Closed

tnt.boom: lack of central on_blast call #1825

Desour opened this issue Jul 9, 2017 · 5 comments

Comments

@Desour
Copy link
Member

Desour commented Jul 9, 2017

It should call the node's on_blast and drop its drop. Here: https://github.com/minetest/minetest_game/blob/master/mods/tnt/init.lua#L388 Maybe check a delete_center field of def because of exploding nodes that shouldn't drop their drops.

@SmallJoker SmallJoker added the Bug label Jul 9, 2017
@cx384
Copy link
Contributor

cx384 commented Jul 9, 2017

How did you noticed that?

@paramat
Copy link
Contributor

paramat commented Jul 9, 2017

The thread title is unclear, deleting is not the problem, it's the lack of central on_blast call and drops.
I guess it is like this because it is usually TNT at the centre, so is this issue due to custom use of tnt_boom()?

Maybe check a delete_center field to def because of exploding nodes that shouldn't drop their drops.

I don't see a need for that yet.

@Desour
Copy link
Member Author

Desour commented Jul 9, 2017

How did you noticed that?

I shot with the handcannon from technic_fight, which uses tnt.boom on impact, on technic's forcefield when it wasn't resistant against blasts yet. I wanted to see how fast I have to shoot to come through. I hit the forcefield emitter and recognized that the forcefield nodes weren't removed. So, I added an on_blast to the forcefield emitter which removes the forcefield nodes. But as I shot at the forcefield emitter again it didn't work and I wondered what I did wrong. After some time I recognized that nothing was dropped but the function returns the disabled emitter. So, I shot near the forcefield emitter and it worked. When I looked into tnt code I saw that at the center pos the blast node was set and everything was clear.

The thread title is unclear, deleting is not the problem, it's the lack of central on_blast call and drops.

I'll change it.

I guess it is like this because it is usually TNT at the centre, so is this issue due to custom use of tnt_boom()?

Yes.

Maybe check a delete_center field to def because of exploding nodes that shouldn't drop their drops.

I don't see a need for that yet.

Tnt uses tnt.boom. And also has a tnt.boom in on_blast. If every tnt.boom would call the central on_blast, tnt would cause an infinite loop.

@Desour Desour changed the title tnt: tnt_boom(pos, def) deletes node at pos tnt.boom: lack of central on_blast call Jul 9, 2017
@paramat
Copy link
Contributor

paramat commented Jul 9, 2017

I see, that's why then, so yes it needs to be optional.

This was referenced Jul 18, 2017
@Desour
Copy link
Member Author

Desour commented Aug 29, 2017

#1844 merged.

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

No branches or pull requests

4 participants