You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 14, 2019. It is now read-only.
As there doesn't seem to be a definite fork/successor to this mod yet, I am posting this issue here.
While testing, I discovered that cme is computing the yaw of mobs in a strange fashion, which will cause the value to become larger than 360, and not simply by accident (I've seen values larger than 720 !). I am working on a minetest patch (minetest/minetest#4425) to prevent values that are too far out of range from causing problems, and it will reject values larger than 720. That means that cme mobs will cause lua errors after the PR is merged.
I created the following quick-and-dirty patch which will adjust the values before setting the yaw. I suppose somebody will want to create a better patch, that ensures the computed yaw will never become too large to begin with (although my PR will accept and adjust values up to 720).
diff--git a/creatures/functions.lua b/creatures/functions.luaindex178bbce..4eb9307 100644--- a/creatures/functions.lua+++b/creatures/functions.lua
@@ -108,6+108,7 @@ localfunctiongetYaw(dirOrYaw)
-- here could be a value based on given yawend+yaw=yaw% (2*math.pi)
returnyawend
@@ -549,7+550,9 @@ creatures.on_step=function(self, dtime)
localmoving_speed=modes[current_mode].moving_speedor0ifmoving_speed>0thenlocalyaw= (getYaw(me:getyaw()) +90.0) *DEGTORAD-me:setyaw(yaw+4.73)
+yaw=yaw+4.73+yaw=yaw% (2*math.pi)
+me:setyaw(yaw)
self.dir= {x=math.cos(yaw), y=0, z=math.sin(yaw)}
ifself.can_flythenifcurrent_pos.y>= (modes["fly"].max_heightor50) andnotself.targetthen
@@ -585,7+588,9 @@ creatures.on_step=function(self, dtime)
mod=me:getyaw()
endlocalyaw= (getYaw(mod) +90.0) *DEGTORAD-me:setyaw(yaw+4.73)
+yaw=yaw+4.73+yaw=yaw% (2*math.pi)
+me:setyaw(yaw)
localmoving_speed=modes[current_mode].moving_speedor0ifmoving_speed>0thenself.dir= {x=math.cos(yaw), y=nil, z=math.sin(yaw)}
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
As there doesn't seem to be a definite fork/successor to this mod yet, I am posting this issue here.
While testing, I discovered that cme is computing the yaw of mobs in a strange fashion, which will cause the value to become larger than 360, and not simply by accident (I've seen values larger than 720 !). I am working on a minetest patch (minetest/minetest#4425) to prevent values that are too far out of range from causing problems, and it will reject values larger than 720. That means that cme mobs will cause lua errors after the PR is merged.
I created the following quick-and-dirty patch which will adjust the values before setting the yaw. I suppose somebody will want to create a better patch, that ensures the computed yaw will never become too large to begin with (although my PR will accept and adjust values up to 720).
The text was updated successfully, but these errors were encountered: