Add TNT explosion damage exhaust

This commit is contained in:
Wuzzy 2017-05-21 05:31:30 +02:00
parent 229fdc067f
commit 2197a48974
2 changed files with 3 additions and 1 deletions

@ -1,4 +1,5 @@
mcl_core
mcl_sounds
mcl_fire
mcl_hunger
doc_identifier?

@ -24,8 +24,9 @@ local function do_tnt_physics(tnt_np,tntr)
if v ~= nil then
obj:setvelocity({x=(p.x - tnt_np.x) + (tntr / 4) + v.x, y=(p.y - tnt_np.y) + (tntr / 2) + v.y, z=(p.z - tnt_np.z) + (tntr / 4) + v.z})
else
if obj:get_player_name() ~= nil then
if obj:is_player() ~= nil then
obj:set_hp(obj:get_hp() - 1)
mcl_hunger.exhaust(obj:get_player_name(), mcl_hunger.EXHAUST_DAMAGE)
end
end
end