forked from VoxeLibre/VoxeLibre
Use vectors in `get_next_mob_spawn_pos()`
This commit is contained in:
parent
8279dcb3dd
commit
0c454a34c9
|
@ -402,11 +402,9 @@ local two_pi = 2 * math.pi
|
||||||
local function get_next_mob_spawn_pos(pos)
|
local function get_next_mob_spawn_pos(pos)
|
||||||
local distance = math_random(25, 32)
|
local distance = math_random(25, 32)
|
||||||
local angle = math_random() * two_pi
|
local angle = math_random() * two_pi
|
||||||
return {
|
local xoff = math_round(distance * math_cos(angle))
|
||||||
x = math_round(pos.x + distance * math_cos(angle)),
|
local yoff = math_round(distance * math_sin(angle))
|
||||||
y = pos.y,
|
return vector.offset(pos, xoff, 0, yoff)
|
||||||
z = math_round(pos.z + distance * math_sin(angle))
|
|
||||||
}
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local function decypher_limits(posy)
|
local function decypher_limits(posy)
|
||||||
|
|
Loading…
Reference in New Issue