7 Commits
5.1.0 ... 5.2.0

Author SHA1 Message Date
sfan5
329b088d1c Fix TNT mod crash when entities disappear during explosion (#2616) 2020-03-06 21:51:19 +01:00
IFRFSX
0c4c6d79c3 Update Chinese Translation, Add Traditional Chinese Translation (#2596) 2020-03-02 21:53:12 +01:00
sfan5
b008c3d819 Convert minetest.sound_play uses to ephemeral 2020-02-05 22:24:23 +01:00
Zaoqi
95ebd6ab85 Add zh_CN translation 2020-01-22 19:09:38 +01:00
Muhammad Nur Hidayat Yasuyoshi (MNH48)
aa71d13511 Add Malay translation 2019-11-30 17:31:40 +01:00
Aresiel
8e3fc0a7ed Add Swedish translation 2019-11-30 17:31:29 +01:00
Andrey2470T
bda65b0c4b Add Russian translation (#2525) 2019-10-24 21:54:20 +02:00
6 changed files with 52 additions and 28 deletions

View File

@@ -163,9 +163,8 @@ local function entity_physics(pos, radius, drops)
local damage = (4 / dist) * radius local damage = (4 / dist) * radius
if obj:is_player() then if obj:is_player() then
-- currently the engine has no method to set -- we knock the player back 1.0 node, and slightly upwards
-- player velocity. See #2960 -- TODO: switch to add_player_velocity() introduced in 5.1
-- instead, we knock the player back 1.0 node, and slightly upwards
local dir = vector.normalize(vector.subtract(obj_pos, pos)) local dir = vector.normalize(vector.subtract(obj_pos, pos))
local moveoff = vector.multiply(dir, dist + 1.0) local moveoff = vector.multiply(dir, dist + 1.0)
local newpos = vector.add(pos, moveoff) local newpos = vector.add(pos, moveoff)
@@ -174,10 +173,13 @@ local function entity_physics(pos, radius, drops)
obj:set_hp(obj:get_hp() - damage) obj:set_hp(obj:get_hp() - damage)
else else
local luaobj = obj:get_luaentity()
-- object might have disappeared somehow
if luaobj then
local do_damage = true local do_damage = true
local do_knockback = true local do_knockback = true
local entity_drops = {} local entity_drops = {}
local luaobj = obj:get_luaentity()
local objdef = minetest.registered_entities[luaobj.name] local objdef = minetest.registered_entities[luaobj.name]
if objdef and objdef.on_blast then if objdef and objdef.on_blast then
@@ -203,6 +205,7 @@ local function entity_physics(pos, radius, drops)
end end
end end
end end
end
local function add_effects(pos, radius, drops) local function add_effects(pos, radius, drops)
minetest.add_particle({ minetest.add_particle({
@@ -274,7 +277,7 @@ function tnt.burn(pos, nodename)
def.on_ignite(pos) def.on_ignite(pos)
elseif minetest.get_item_group(name, "tnt") > 0 then elseif minetest.get_item_group(name, "tnt") > 0 then
minetest.swap_node(pos, {name = name .. "_burning"}) minetest.swap_node(pos, {name = name .. "_burning"})
minetest.sound_play("tnt_ignite", {pos = pos}) minetest.sound_play("tnt_ignite", {pos = pos}, true)
minetest.get_node_timer(pos):start(1) minetest.get_node_timer(pos):start(1)
end end
end end
@@ -403,7 +406,7 @@ function tnt.boom(pos, def)
end end
local sound = def.sound or "tnt_explode" local sound = def.sound or "tnt_explode"
minetest.sound_play(sound, {pos = pos, gain = 2.5, minetest.sound_play(sound, {pos = pos, gain = 2.5,
max_hear_distance = math.min(def.radius * 20, 128)}) max_hear_distance = math.min(def.radius * 20, 128)}, true)
local drops, radius = tnt_explode(pos, def.radius, def.ignore_protection, local drops, radius = tnt_explode(pos, def.radius, def.ignore_protection,
def.ignore_on_blast, owner, def.explode_center) def.ignore_on_blast, owner, def.explode_center)
-- append entity drops -- append entity drops
@@ -541,7 +544,8 @@ minetest.register_node("tnt:gunpowder_burning", {
-- unaffected by explosions -- unaffected by explosions
on_blast = function() end, on_blast = function() end,
on_construct = function(pos) on_construct = function(pos)
minetest.sound_play("tnt_gunpowder_burning", {pos = pos, gain = 2}) minetest.sound_play("tnt_gunpowder_burning", {pos = pos,
gain = 2}, true)
minetest.get_node_timer(pos):start(1) minetest.get_node_timer(pos):start(1)
end, end,
}) })
@@ -672,7 +676,7 @@ function tnt.register_tnt(def)
-- unaffected by explosions -- unaffected by explosions
on_blast = function() end, on_blast = function() end,
on_construct = function(pos) on_construct = function(pos)
minetest.sound_play("tnt_ignite", {pos = pos}) minetest.sound_play("tnt_ignite", {pos = pos}, true)
minetest.get_node_timer(pos):start(4) minetest.get_node_timer(pos):start(4)
minetest.check_for_falling(pos) minetest.check_for_falling(pos)
end, end,

4
locale/tnt.ms.tr Normal file
View File

@@ -0,0 +1,4 @@
# textdomain: tnt
Gun Powder=Serbuk Senjata Api
TNT Stick=Batang TNT
TNT=TNT

4
locale/tnt.ru.tr Normal file
View File

@@ -0,0 +1,4 @@
# textdomain: tnt
Gun Powder=Порох
TNT Stick=Тротиловая Палка
TNT=Тротил

4
locale/tnt.se.tr Normal file
View File

@@ -0,0 +1,4 @@
# textdomain: tnt
Gun Powder=Krut
TNT Stick=Dynamitpinne
TNT=Dynamit

4
locale/tnt.zh_CN.tr Normal file
View File

@@ -0,0 +1,4 @@
# textdomain: tnt
Gun Powder=火药粉
TNT Stick=炸药棒
TNT=炸药包

4
locale/tnt.zh_TW.tr Normal file
View File

@@ -0,0 +1,4 @@
# textdomain: tnt
Gun Powder=火藥粉
TNT Stick=炸藥棒
TNT=炸藥包