mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2025-03-22 05:52:30 +01:00
Properly fix arrows crashing the server
This commit is contained in:
@ -16,23 +16,17 @@ local dir_to_pitch = function(dir)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local random_arrow_positions = function(positions, placement)
|
local random_arrow_positions = function(positions, placement)
|
||||||
local min = 0
|
|
||||||
local max = 1
|
|
||||||
if positions == 'x' then
|
if positions == 'x' then
|
||||||
min = -4
|
return math.random(-4, 4)
|
||||||
max = 4
|
|
||||||
elseif positions == 'y' then
|
elseif positions == 'y' then
|
||||||
min = 0
|
return math.random(0, 10)
|
||||||
max = 10
|
|
||||||
end
|
end
|
||||||
if placement == 'front' and positions == 'z' then
|
if placement == 'front' and positions == 'z' then
|
||||||
min = 3
|
return 3
|
||||||
max = 3
|
|
||||||
elseif placement == 'back' and positions == 'z' then
|
elseif placement == 'back' and positions == 'z' then
|
||||||
min = -3
|
return -3
|
||||||
max = -3
|
|
||||||
end
|
end
|
||||||
return math.random(max, min)
|
return 0
|
||||||
end
|
end
|
||||||
|
|
||||||
local mod_awards = minetest.get_modpath("awards") and minetest.get_modpath("mcl_achievements")
|
local mod_awards = minetest.get_modpath("awards") and minetest.get_modpath("mcl_achievements")
|
||||||
|
Reference in New Issue
Block a user