mirror of
https://codeberg.org/tenplus1/mobs_redo.git
synced 2024-12-25 02:00:21 +01:00
getyaw() to get_yaw()
This commit is contained in:
parent
84672a07ce
commit
7c4dc07acd
12
api.lua
12
api.lua
@ -1,9 +1,9 @@
|
|||||||
|
|
||||||
-- Mobs Api (20th September 2017)
|
-- Mobs Api (21st September 2017)
|
||||||
|
|
||||||
mobs = {}
|
mobs = {}
|
||||||
mobs.mod = "redo"
|
mobs.mod = "redo"
|
||||||
mobs.version = "20170920"
|
mobs.version = "20170921"
|
||||||
|
|
||||||
|
|
||||||
-- Intllib
|
-- Intllib
|
||||||
@ -112,7 +112,7 @@ end
|
|||||||
-- move mob in facing direction
|
-- move mob in facing direction
|
||||||
local set_velocity = function(self, v)
|
local set_velocity = function(self, v)
|
||||||
|
|
||||||
local yaw = (self.object:getyaw() or 0) + self.rotate
|
local yaw = (self.object:get_yaw() or 0) + self.rotate
|
||||||
|
|
||||||
self.object:setvelocity({
|
self.object:setvelocity({
|
||||||
x = sin(yaw) * -v,
|
x = sin(yaw) * -v,
|
||||||
@ -509,7 +509,7 @@ local is_at_cliff = function(self)
|
|||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
local yaw = self.object:getyaw()
|
local yaw = self.object:get_yaw()
|
||||||
local dir_x = -sin(yaw) * (self.collisionbox[4] + 0.5)
|
local dir_x = -sin(yaw) * (self.collisionbox[4] + 0.5)
|
||||||
local dir_z = cos(yaw) * (self.collisionbox[4] + 0.5)
|
local dir_z = cos(yaw) * (self.collisionbox[4] + 0.5)
|
||||||
local pos = self.object:getpos()
|
local pos = self.object:getpos()
|
||||||
@ -680,7 +680,7 @@ self.facing_fence = false
|
|||||||
end
|
end
|
||||||
|
|
||||||
local pos = self.object:getpos()
|
local pos = self.object:getpos()
|
||||||
local yaw = self.object:getyaw()
|
local yaw = self.object:get_yaw()
|
||||||
|
|
||||||
-- what is mob standing on?
|
-- what is mob standing on?
|
||||||
pos.y = pos.y + self.collisionbox[2] - 0.2
|
pos.y = pos.y + self.collisionbox[2] - 0.2
|
||||||
@ -1129,7 +1129,7 @@ local smart_mobs = function(self, s, p, dist, dtime)
|
|||||||
|
|
||||||
else -- dig 2 blocks to make door toward player direction
|
else -- dig 2 blocks to make door toward player direction
|
||||||
|
|
||||||
local yaw1 = self.object:getyaw() + pi / 2
|
local yaw1 = self.object:get_yaw() + pi / 2
|
||||||
local p1 = {
|
local p1 = {
|
||||||
x = s.x + cos(yaw1),
|
x = s.x + cos(yaw1),
|
||||||
y = s.y,
|
y = s.y,
|
||||||
|
@ -155,8 +155,8 @@ function mobs.attach(entity, player)
|
|||||||
default.player_set_animation(player, "sit" , 30)
|
default.player_set_animation(player, "sit" , 30)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
--player:set_look_yaw(entity.object:getyaw() - rot_view)
|
--player:set_look_yaw(entity.object:get_yaw() - rot_view)
|
||||||
player:set_look_horizontal(entity.object:getyaw() - rot_view)
|
player:set_look_horizontal(entity.object:get_yaw() - rot_view)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@ -355,7 +355,7 @@ function mobs.drive(entity, moving_anim, stand_anim, can_fly, dtime)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
new_velo = get_velocity(v, entity.object:getyaw() - rot_view, velo.y)
|
new_velo = get_velocity(v, entity.object:get_yaw() - rot_view, velo.y)
|
||||||
new_acce.y = new_acce.y + acce_y
|
new_acce.y = new_acce.y + acce_y
|
||||||
|
|
||||||
entity.object:setvelocity(new_velo)
|
entity.object:setvelocity(new_velo)
|
||||||
|
Loading…
Reference in New Issue
Block a user