mirror of
https://codeberg.org/tenplus1/mobs_monster.git
synced 2024-12-23 01:10:26 +01:00
math local
This commit is contained in:
parent
70edecd5bb
commit
5d8bcde2ae
@ -13,6 +13,8 @@ local function get_velocity(self)
|
|||||||
return (v.x * v.x + v.z * v.z) ^ 0.5
|
return (v.x * v.x + v.z * v.z) ^ 0.5
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local math_cos, math_sin = math.cos, math.sin
|
||||||
|
|
||||||
-- custom spider types
|
-- custom spider types
|
||||||
|
|
||||||
local spider_types = {
|
local spider_types = {
|
||||||
@ -168,8 +170,8 @@ mobs:register_mob("mobs_monster:spider", {
|
|||||||
|
|
||||||
pos.y = pos.y + prop.collisionbox[2] - 0.2
|
pos.y = pos.y + prop.collisionbox[2] - 0.2
|
||||||
|
|
||||||
local dir_x = -math.sin(yaw) * (prop.collisionbox[4] + 0.5)
|
local dir_x = -math_sin(yaw) * (prop.collisionbox[4] + 0.5)
|
||||||
local dir_z = math.cos(yaw) * (prop.collisionbox[4] + 0.5)
|
local dir_z = math_cos(yaw) * (prop.collisionbox[4] + 0.5)
|
||||||
local nod = minetest.get_node_or_nil({
|
local nod = minetest.get_node_or_nil({
|
||||||
x = pos.x + dir_x,
|
x = pos.x + dir_x,
|
||||||
y = pos.y + 0.5,
|
y = pos.y + 0.5,
|
||||||
|
Loading…
Reference in New Issue
Block a user