1
0
Fork 0

Compare commits

...

10 Commits

Author SHA1 Message Date
the-real-herowl 72435933e4 Add defensive check (#4437)
This fixes #4436 and possible other unnoticed crashes by adding a defensive check.

Reviewed-on: VoxeLibre/VoxeLibre#4437
Reviewed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
Co-authored-by: the-real-herowl <wiktor_t-i@proton.me>
Co-committed-by: the-real-herowl <wiktor_t-i@proton.me>
2024-06-15 03:51:03 +02:00
the-real-herowl 35e14dd415 Potion conversion fix (#4426)
Reviewed-on: VoxeLibre/VoxeLibre#4426
Reviewed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
Co-authored-by: the-real-herowl <wiktor_t-i@proton.me>
Co-committed-by: the-real-herowl <wiktor_t-i@proton.me>
2024-06-13 13:22:14 +02:00
the-real-herowl 173f8a0bca Effect loading fixes (#4425)
Reviewed-on: VoxeLibre/VoxeLibre#4425
Reviewed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
Co-authored-by: the-real-herowl <wiktor_t-i@proton.me>
Co-committed-by: the-real-herowl <wiktor_t-i@proton.me>
2024-06-13 13:21:36 +02:00
teknomunk 1f32b47208 Fix crash while fighting whither (#4392)
Reviewed-on: VoxeLibre/VoxeLibre#4392
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: teknomunk <teknomunk@protonmail.com>
Co-committed-by: teknomunk <teknomunk@protonmail.com>
2024-06-12 14:18:03 +02:00
SmokeyDope bf67fd52e1 Zombie texture improvements (#4260)
Reviewed-on: VoxeLibre/VoxeLibre#4260
Reviewed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
Co-authored-by: SmokeyDope <smokey@tilde.team>
Co-committed-by: SmokeyDope <smokey@tilde.team>
2024-06-11 19:38:41 +02:00
WillConker fd4e1484af Fix crash on high levels of frost walker (#4423)
Reviewed-on: VoxeLibre/VoxeLibre#4423
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: WillConker <willconker@noreply.git.minetest.land>
Co-committed-by: WillConker <willconker@noreply.git.minetest.land>
2024-06-11 19:17:12 +02:00
teknomunk 1b0deae026 Fix crash when bonemealing sweet berry bushes (#4419)
Reviewed-on: VoxeLibre/VoxeLibre#4419
Reviewed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
Co-authored-by: teknomunk <teknomunk@protonmail.com>
Co-committed-by: teknomunk <teknomunk@protonmail.com>
2024-06-11 18:47:18 +02:00
teknomunk 313c1f558b Make all hollow logs breakable (#4418)
Reviewed-on: VoxeLibre/VoxeLibre#4418
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: teknomunk <teknomunk@protonmail.com>
Co-committed-by: teknomunk <teknomunk@protonmail.com>
2024-06-11 18:43:33 +02:00
teknomunk 5cafa97dd1 Fix formspec code that reads strength button field (#4385)
Reviewed-on: VoxeLibre/VoxeLibre#4385
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: teknomunk <teknomunk@protonmail.com>
Co-committed-by: teknomunk <teknomunk@protonmail.com>
2024-06-11 18:40:44 +02:00
teknomunk ddab68b87c Add instructions on how to eat to basic controls help entry (#4420)
Reviewed-on: VoxeLibre/VoxeLibre#4420
Reviewed-by: ancientmarinerdev <ancientmariner_dev@proton.me>
Co-authored-by: teknomunk <teknomunk@protonmail.com>
Co-committed-by: teknomunk <teknomunk@protonmail.com>
2024-06-10 19:44:30 +00:00
11 changed files with 73 additions and 45 deletions

View File

@ -802,34 +802,37 @@ function mob_class:on_punch(hitter, tflp, tool_capabilities, dir)
end
-- alert others to the attack
local objs = minetest.get_objects_inside_radius(hitter:get_pos(), self.view_range)
local obj = nil
local alert_pos = hitter:get_pos()
if alert_pos then
local objs = minetest.get_objects_inside_radius(alert_pos, self.view_range)
local obj = nil
for n = 1, #objs do
for n = 1, #objs do
obj = objs[n]:get_luaentity()
obj = objs[n]:get_luaentity()
if obj then
-- only alert members of same mob or friends
if obj.group_attack
and obj.state ~= "attack"
and obj.owner ~= name then
if obj.name == self.name then
obj:do_attack(hitter)
elseif type(obj.group_attack) == "table" then
for i=1, #obj.group_attack do
if obj.group_attack[i] == self.name then
obj._aggro = true
obj:do_attack(hitter)
break
if obj then
-- only alert members of same mob or friends
if obj.group_attack
and obj.state ~= "attack"
and obj.owner ~= name then
if obj.name == self.name then
obj:do_attack(hitter)
elseif type(obj.group_attack) == "table" then
for i=1, #obj.group_attack do
if obj.group_attack[i] == self.name then
obj._aggro = true
obj:do_attack(hitter)
break
end
end
end
end
end
-- have owned mobs attack player threat
if obj.owner == name and obj.owner_loyal then
obj:do_attack(self.object)
-- have owned mobs attack player threat
if obj.owner == name and obj.owner_loyal then
obj:do_attack(self.object)
end
end
end
end

View File

@ -126,6 +126,9 @@ S("• I: Show/hide inventory menu").."\n\n"..
S("Inventory interaction:").."\n"..
S("See the entry “Basics > Inventory”.").."\n\n"..
S("Hunger/Eating:").."\n"..
S("• While holding food, hold the right mouse button (PC) or double-tap and hold the second tap (Android) to eat").."\n\n"..
S("Camera:").."\n"..
S("• Z: Zoom").."\n"..
S("• F7: Toggle camera mode").."\n\n"..

View File

@ -78,6 +78,8 @@ World interaction:=
• I: Show/hide inventory menu=
Inventory interaction:=
See the entry “Basics > Inventory”.=
Hunger/Eating:=
• While holding food, hold the right mouse button (PC) or double-tap and hold the second tap (Android) to eat=
Camera:=
• Z: Zoom=
• F7: Toggle camera mode=

View File

@ -265,7 +265,7 @@ minetest.register_node("mcl_beacons:beacon", {
remove_beacon_beam(pos)
end,
on_receive_fields = function(pos, formname, fields, sender)
if fields.swiftness or fields.regeneration or fields.leaping or fields.strenght
if fields.swiftness or fields.regeneration or fields.leaping or fields.strength
or fields.haste or fields.resistance or fields.absorption or fields.slow_falling then
local sender_name = sender:get_player_name()
local power_level = beacon_blockcheck(pos)
@ -329,7 +329,7 @@ minetest.register_node("mcl_beacons:beacon", {
end
minetest.get_meta(pos):set_string("effect","resistance")
successful = true
elseif fields.strenght and power_level >= 3 then
elseif fields.strength and power_level >= 3 then
if power_level == 4 then
minetest.get_meta(pos):set_int("effect_level",2)
else

View File

@ -205,7 +205,8 @@ walkover.register_global(function(pos, _, player)
if frost_walker <= 0 then
return
end
local radius = frost_walker + 2
-- 1011 = sqrt(4096000)/2; 4096000 is the max number of nodes for find_nodes_in_area_under_air
local radius = math.min(frost_walker + 2, 1011)
local minp = {x = pos.x - radius, y = pos.y, z = pos.z - radius}
local maxp = {x = pos.x + radius, y = pos.y, z = pos.z + radius}
local positions = minetest.find_nodes_in_area_under_air(minp, maxp, "mcl_core:water_source")

View File

@ -53,7 +53,7 @@ for i=0, 3 do
end
if 3 ~= i and mcl_dye and
clicker:get_wielded_item():get_name() == "mcl_bone_meal:bone_meal" then
mcl_dye.apply_bone_meal({under=pos},clicker)
mcl_dye.apply_bone_meal({under=pos, above=vector.offset(pos,0,1,0)},clicker)
if not minetest.is_creative_enabled(pn) then
itemstack:take_item()
end

View File

@ -456,6 +456,10 @@ mcl_potions.register_effect({
object:get_meta():set_int("night_vision", 1)
mcl_weather.skycolor.update_sky_color({object})
end,
on_load = function(object, factor)
object:get_meta():set_int("night_vision", 1)
mcl_weather.skycolor.update_sky_color({object})
end,
on_step = function(dtime, object, factor, duration)
mcl_weather.skycolor.update_sky_color({object})
end,
@ -1352,7 +1356,7 @@ minetest.register_globalstep(function(dtime)
potions_set_hud(object)
else
local ent = object:get_luaentity()
if ent then
if ent and ent._mcl_potions then
ent._mcl_potions["_EF_"..name] = nil
end
end
@ -1367,7 +1371,7 @@ minetest.register_globalstep(function(dtime)
end
else
local ent = object:get_luaentity()
if ent then
if ent and ent._mcl_potions then
ent._mcl_potions["_EF_"..name] = EF[name][object]
end
end
@ -1525,6 +1529,11 @@ function mcl_potions._load_player_effects(player)
local loaded = minetest.deserialize(meta:get_string("mcl_potions:_EF_"..name))
if loaded then
EF[name][player] = loaded
end
if EF[name][player] then -- this is needed because of legacy effects loaded separately
if effect.uses_factor and type(EF[name][player].factor) ~= "number" then
EF[name][player].factor = effect.level_to_factor(1)
end
if effect.on_load then
effect.on_load(player, EF[name][player].factor)
end
@ -1542,6 +1551,9 @@ function mcl_potions._load_entity_effects(entity)
local loaded = entity._mcl_potions["_EF_"..name]
if loaded then
EF[name][object] = loaded
if effect.uses_factor and not loaded.factor then
EF[name][object].factor = effect.level_to_factor(1)
end
if effect.on_load then
effect.on_load(object, EF[name][object].factor)
end
@ -1780,9 +1792,14 @@ end
local function target_valid(object, name)
if not object or object:get_hp() <= 0 then return false end
-- Don't apply effects to anything other than players and entities that have mcl_potions support
-- but are not bosses
local entity = object:get_luaentity()
if entity and entity.is_boss then return false end
if not object:is_player() and (not entity or entity.is_boss or not entity._mcl_potions) then
return false
end
-- Check resistances
for i=1, #registered_res_predicates do
if registered_res_predicates[i](object, name) then return false end
end

View File

@ -841,20 +841,22 @@ local function replace_legacy_potion(itemstack)
end
local compat = "mcl_potions:compat_potion"
local compat_arrow = "mcl_potions:compat_arrow"
minetest.register_craftitem(compat, {
description = S("Unknown Potion"),
_tt_help = S("Right-click to identify"),
local compat_def = {
description = S("Unknown Potion") .. "\n" .. minetest.colorize("#ff0", S("Right-click to identify")),
image = "mcl_potions_potion_overlay.png^[colorize:#00F:127^mcl_potions_potion_bottle.png^vl_unknown.png",
groups = {not_in_creative_inventory = 1},
on_secondary_use = replace_legacy_potion,
on_place = replace_legacy_potion,
})
minetest.register_craftitem(compat_arrow, {
description = S("Unknown Tipped Arrow"),
_tt_help = S("Right-click to identify"),
}
local compat_arrow_def = {
description = S("Unknown Tipped Arrow") .. "\n" .. minetest.colorize("#ff0", S("Right-click to identify")),
image = "mcl_bows_arrow_inv.png^(mcl_potions_arrow_inv.png^[colorize:#FFF:100)^vl_unknown.png",
groups = {not_in_creative_inventory = 1},
on_secondary_use = replace_legacy_potion,
on_place = replace_legacy_potion,
})
}
minetest.register_craftitem(compat, compat_def)
minetest.register_craftitem(compat_arrow, compat_arrow_def)
local old_potions_plus = {
"fire_resistance", "water_breathing", "invisibility", "regeneration", "poison",
@ -866,14 +868,14 @@ local old_potions_2 = {
}
for _, name in pairs(old_potions_2) do
minetest.register_alias("mcl_potions:" .. name .. "_2", compat)
minetest.register_alias("mcl_potions:" .. name .. "_2_splash", compat)
minetest.register_alias("mcl_potions:" .. name .. "_2_lingering", compat)
minetest.register_alias("mcl_potions:" .. name .. "_2_arrow", compat_arrow)
minetest.register_craftitem("mcl_potions:" .. name .. "_2", compat_def)
minetest.register_craftitem("mcl_potions:" .. name .. "_2_splash", compat_def)
minetest.register_craftitem("mcl_potions:" .. name .. "_2_lingering", compat_def)
minetest.register_craftitem("mcl_potions:" .. name .. "_2_arrow", compat_arrow_def)
end
for _, name in pairs(old_potions_plus) do
minetest.register_alias("mcl_potions:" .. name .. "_plus", compat)
minetest.register_alias("mcl_potions:" .. name .. "_plus_splash", compat)
minetest.register_alias("mcl_potions:" .. name .. "_plus_lingering", compat)
minetest.register_alias("mcl_potions:" .. name .. "_plus_arrow", compat_arrow)
minetest.register_craftitem("mcl_potions:" .. name .. "_plus", compat_def)
minetest.register_craftitem("mcl_potions:" .. name .. "_plus_splash", compat_def)
minetest.register_craftitem("mcl_potions:" .. name .. "_plus_lingering", compat_def)
minetest.register_craftitem("mcl_potions:" .. name .. "_plus_arrow", compat_arrow_def)
end

View File

@ -43,7 +43,7 @@ function vl_hollow_logs.register_hollow_log(defs)
local groups = {axey = 1, building_block = 1, handy = 1, hollow_log = 1}
if not defs[5] then
groups = table.insert(groups, {fire_encouragement = 5, fire_flammability = 5, flammable = 2, hollow_log_burnable = 1})
table.update(groups, {fire_encouragement = 5, fire_flammability = 5, flammable = 2, hollow_log_burnable = 1})
end
minetest.register_node(modname .. ":"..name.."_hollow", {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 317 B

After

Width:  |  Height:  |  Size: 412 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB