aboutsummaryrefslogtreecommitdiff
path: root/advtrains/damage.lua
diff options
context:
space:
mode:
authororwell96 <mono96.mml@gmail.com>2017-01-04 19:10:03 +0100
committerorwell96 <mono96.mml@gmail.com>2017-01-04 19:10:03 +0100
commit2d0b51b8970abb16c166708988e46fe4df668d47 (patch)
treeacd850e00f2c25f3a38f97b670e185d58697b777 /advtrains/damage.lua
parent853a9e690eeeb48aa1a13faa66db0a91d5b49390 (diff)
downloadadvtrains-2d0b51b8970abb16c166708988e46fe4df668d47.tar.gz
advtrains-2d0b51b8970abb16c166708988e46fe4df668d47.tar.bz2
advtrains-2d0b51b8970abb16c166708988e46fe4df668d47.zip
Restructure mod directory
Diffstat (limited to 'advtrains/damage.lua')
-rw-r--r--advtrains/damage.lua26
1 files changed, 0 insertions, 26 deletions
diff --git a/advtrains/damage.lua b/advtrains/damage.lua
deleted file mode 100644
index b39fe67..0000000
--- a/advtrains/damage.lua
+++ /dev/null
@@ -1,26 +0,0 @@
---damage.lua
---a globalstep that damages players overrolled by trains.
-
-advtrains.player_to_train_mapping={}
-
-local tmr=0
-minetest.register_globalstep(function(dtime)
- tmr=tmr-dtime
- if tmr<=0 then
-
- for _, player in pairs(minetest.get_connected_players()) do
- local pos=player:getpos()
- for _, object in pairs(minetest.get_objects_inside_radius(pos, 1)) do
- local le=object:get_luaentity()
- if le and le.is_wagon and le.initialized and le:train() then
- if (not advtrains.player_to_train_mapping[player:get_player_name()] or le.train_id~=advtrains.player_to_train_mapping[player:get_player_name()]) and math.abs(le:train().velocity)>2 then
- --player:punch(object, 1000, {damage={fleshy=3*math.abs(le:train().velocity)}})
- player:set_hp(player:get_hp()-math.abs(le:train().velocity)-3)
- end
- end
- end
- end
-
- tmr=0.5
- end
-end)