summaryrefslogtreecommitdiff
path: root/snow.lua
diff options
context:
space:
mode:
authorBremaweb <brandon@bremaweb.com>2013-10-05 10:10:41 -0700
committerBremaweb <brandon@bremaweb.com>2013-10-05 10:10:41 -0700
commit391d37c8356d2628a844c9a3d95bf397981950a7 (patch)
treed9703045fedf3948e8d775db0504c2a0381c4e89 /snow.lua
parent2f208687d7f56af0056a9b5bb1d24360d1e619df (diff)
parent535928dee838cf5e79703bef3721cd1021258e7b (diff)
Merge pull request #3 from fairiestoy/master
Quick Snowball fix
Diffstat (limited to 'snow.lua')
-rw-r--r--snow.lua27
1 files changed, 27 insertions, 0 deletions
diff --git a/snow.lua b/snow.lua
new file mode 100644
index 0000000..7f21548
--- /dev/null
+++ b/snow.lua
@@ -0,0 +1,27 @@
+--[[
+Snow mod rewrite to make it secure for use on landrush
+This is a quick workaround before we can upload
+an working fix which restores original functionality
+]]
+if minetest.get_modpath( 'snow' ) then
+ local entity_prototype = minetest.registered_entities['snow:snowball_entity']
+ if not entity_prototype then
+ print( 'COuld not detect snowball prototype...')
+ return
+ end
+ entity_prototype.on_step = function(self, dtime)
+ self.timer=self.timer+dtime
+ local pos = self.object:getpos()
+ local node = minetest.get_node(pos)
+
+ if self.lastpos.x~=nil then
+ if node.name ~= "air" then
+ if landrush.can_interact( ' ', pos ) then
+ snow.place(pos)
+ end
+ self.object:remove()
+ end
+ end
+ self.lastpos={x=pos.x, y=pos.y, z=pos.z} -- Set lastpos-->Node will be added at last pos outside the node
+ end
+end