Minor fixes, add optional node drops

This commit is contained in:
stujones11 2019-03-24 15:22:34 +00:00
parent 20405958da
commit 0d58b85a66
2 changed files with 18 additions and 0 deletions

View file

@ -74,6 +74,13 @@ Defaults to `false` in singleplayer mode
`shooter_allow_players = true`
### Node Drops
Drops the node item when hit, requires `shooter_allow_nodes` to be `true`
Currently excludes 'blasting'
`shooter_node_drops = false`
### Round update time
Maximum round 'step' processing interval, will inversely effect the long-range velocity of the virtual projectiles. This should always be greater than the dedicated server step time

View file

@ -29,6 +29,7 @@ shooter.config = {
enable_protection = false,
enable_crafting = true,
explosion_texture = "shooter_hit.png",
node_drops = false,
allow_nodes = true,
allow_entities = false,
allow_players = true,
@ -199,6 +200,16 @@ shooter.punch_node = function(pos, spec)
shooter.spawn_particles(pos, {texture=item.tiles[1]})
end
end
if config.node_drops then
local object = minetest.add_item(pos, item)
if object then
object:set_velocity({
x = math.random(-1, 1),
y = 4,
z = math.random(-1, 1)
})
end
end
return true
end
end