diff options
author | orwell96 <mono96.mml@gmail.com> | 2016-12-05 20:53:43 +0100 |
---|---|---|
committer | orwell96 <mono96.mml@gmail.com> | 2016-12-05 20:53:43 +0100 |
commit | 631636f75706659dba11afc3a9d8075d8278fe43 (patch) | |
tree | 7d560760666e94e91d903a0293717414ff86f449 /damage.lua | |
parent | 8f5c0feb45555fc92578936a314b1d3a3422c60d (diff) | |
download | advtrains-631636f75706659dba11afc3a9d8075d8278fe43.tar.gz advtrains-631636f75706659dba11afc3a9d8075d8278fe43.tar.bz2 advtrains-631636f75706659dba11afc3a9d8075d8278fe43.zip |
try to fix damage bug
Diffstat (limited to 'damage.lua')
-rw-r--r-- | damage.lua | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1,7 +1,7 @@ --damage.lua --a globalstep that damages players overrolled by trains. -advtrains.player_to_wagon_mapping={} +advtrains.player_to_train_mapping={} local tmr=0 minetest.register_globalstep(function(dtime) @@ -13,7 +13,7 @@ minetest.register_globalstep(function(dtime) 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_wagon_mapping[player:get_player_name()] or le.train_id~=advtrains.player_to_wagon_mapping[player:get_player_name()].train_id) and math.abs(le:train().velocity)>2 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 |