diff --git a/scripts/turrets.lua b/scripts/turrets.lua index c01c933..dd8ed7d 100644 --- a/scripts/turrets.lua +++ b/scripts/turrets.lua @@ -86,7 +86,7 @@ minetest.register_entity( self._tmr = self._tmr + elapsed self.object:set_yaw(math.rad(math.fmod((math.floor(math.fmod(math.deg(self.object:get_yaw()), 360) / 90) * 90), 360))) --get yaw and convert it into param2 - local p = self.object:getyaw() + local p = self.object:get_yaw() --convert yaw from rad to degrees local yaw = math.deg(p) yaw = math.floor(yaw / 90) @@ -97,7 +97,7 @@ minetest.register_entity( p = yaw --add -y force local force = {x = 0, y = -10, z = 0} - self.object:setvelocity(force) + self.object:set_velocity(force) if self._tmr < 0.2 then return else @@ -135,14 +135,14 @@ minetest.register_entity( end if d then local bullet_ent = minetest.add_entity(pos1, "portalgun:bullet1") - bullet_ent:setvelocity(d) + bullet_ent:set_velocity(d) --rotate bullet to by 90 degrees in x axis local yaw = math.rad(math.fmod((math.floor(math.fmod(math.deg(self.object:get_yaw()), 360) / 90) * 90), 360)) bullet_ent:set_yaw(yaw) minetest.sound_play("portalgun_bullet1", {pos = pos, gain = 1, max_hear_distance = 15}) else local obj = minetest.add_entity(pos1, "portalgun:turretgun") - obj:setyaw(self.object:getyaw()) + obj:setyaw(self.object:get_yaw()) self.object:remove() end return true @@ -226,7 +226,7 @@ minetest.register_entity( on_step = function(self, elapsed, moveresult) self.object:set_yaw(math.rad(math.fmod((math.floor(math.fmod(math.deg(self.object:get_yaw()), 360) / 90) * 90), 360))) --get yaw and convert it into param2 - local p = self.object:getyaw() + local p = self.object:get_yaw() --convert yaw from rad to degrees local yaw = math.deg(p) yaw = math.floor(yaw / 90) @@ -238,7 +238,7 @@ minetest.register_entity( local pos = self.object:get_pos() local pos1 = {x = pos.x, y = pos.y + 0.5, z = pos.z} local force = {x = 0, y = -10, z = 0} - self.object:setvelocity(force) + self.object:set_velocity(force) self._tmr = self._tmr + elapsed if self._tmr < 0.2 then return @@ -278,7 +278,7 @@ minetest.register_entity( if d then local obj = minetest.add_entity(pos1, "portalgun:turretgun2") --set yaw to same as this object - obj:setyaw(self.object:getyaw()) + obj:setyaw(self.object:get_yaw()) self.object:remove() end return true