Add casts to numeric config options.
This commit is contained in:
parent
aaf861e497
commit
c70adf6f7a
8
ammo.lua
8
ammo.lua
@ -282,9 +282,9 @@ for _, dmg in pairs(actualDamage) do
|
|||||||
damage[_] = actualDamage[_]
|
damage[_] = actualDamage[_]
|
||||||
end
|
end
|
||||||
|
|
||||||
local player_dmg_multiplier = minetest.settings:get("rangedweapons_player_dmg_multiplier") or 1.0
|
local player_dmg_multiplier = tonumber(minetest.settings:get("rangedweapons_player_dmg_multiplier")) or 1.0
|
||||||
local headshot_dmg_multiplier = minetest.settings:get("rangedweapons_headshot_dmg_multiplier") or 1.75
|
local headshot_dmg_multiplier = tonumber(minetest.settings:get("rangedweapons_headshot_dmg_multiplier")) or 1.75
|
||||||
local mob_dmg_multiplier = minetest.settings:get("rangedweapons_mob_dmg_multiplier") or 1.0
|
local mob_dmg_multiplier = tonumber(minetest.settings:get("rangedweapons_mob_dmg_multiplier")) or 1.0
|
||||||
|
|
||||||
if moveresult.collisions[1].object:is_player() then
|
if moveresult.collisions[1].object:is_player() then
|
||||||
for _, player_dmg in pairs(damage) do
|
for _, player_dmg in pairs(damage) do
|
||||||
@ -327,7 +327,7 @@ moveresult.collisions[1].object:punch(owner, 1.0, {
|
|||||||
damage_groups = damage,}, nil)
|
damage_groups = damage,}, nil)
|
||||||
owner:hud_change(hit, "text", hit_texture)
|
owner:hud_change(hit, "text", hit_texture)
|
||||||
|
|
||||||
local bloodyness = minetest.settings:get("rangedweapons_bloodyness") or 10
|
local bloodyness = tonumber(minetest.settings:get("rangedweapons_bloodyness")) or 10
|
||||||
for i=1,math.random(math.ceil(bloodyness*0.66),math.ceil(bloodyness*1.5)) do
|
for i=1,math.random(math.ceil(bloodyness*0.66),math.ceil(bloodyness*1.5)) do
|
||||||
minetest.add_particle({
|
minetest.add_particle({
|
||||||
pos = self.object:get_pos(),
|
pos = self.object:get_pos(),
|
||||||
|
2
init.lua
2
init.lua
@ -39,7 +39,7 @@ minetest.sound_play("rengedweapons_ricochet", {pos = pos, gain = 0.75})
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local max_gun_efficiency = minetest.settings:get("rangedweapons_max_gun_efficiency") or 300
|
local max_gun_efficiency = tonumber(minetest.settings:get("rangedweapons_max_gun_efficiency")) or 300
|
||||||
|
|
||||||
rangedweapons_gain_skill = function(player,skill,chance)
|
rangedweapons_gain_skill = function(player,skill,chance)
|
||||||
|
|
||||||
|
@ -79,7 +79,7 @@ end
|
|||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
local min_gun_efficiency = minetest.settings:get("rangedweapons_min_gun_efficiency") or 40
|
local min_gun_efficiency = tonumber(minetest.settings:get("rangedweapons_min_gun_efficiency")) or 40
|
||||||
|
|
||||||
local timer = 0
|
local timer = 0
|
||||||
minetest.register_globalstep(function(dtime, player)
|
minetest.register_globalstep(function(dtime, player)
|
||||||
|
Loading…
Reference in New Issue
Block a user