From 8d97207749e76d66440a97b5e50a7ff8903cbd05 Mon Sep 17 00:00:00 2001 From: Alexsandro Percy Date: Wed, 8 Nov 2023 18:49:53 -0300 Subject: [PATCH] fixing undeclared variables --- airutils_tug.lua | 4 ++-- lib_planes/entities.lua | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/airutils_tug.lua b/airutils_tug.lua index 44fe16d..8830196 100644 --- a/airutils_tug.lua +++ b/airutils_tug.lua @@ -9,8 +9,8 @@ function airutils.move_target(player, pointed_thing) if object then local obj_pos = object:get_pos() local hip = math.sqrt(math.pow(obj_pos.x - pos.x,2)+math.pow(obj_pos.z - pos.z,2)) + 1 - pos_x = math.sin(yaw) * -hip - pos_z = math.cos(yaw) * hip + local pos_x = math.sin(yaw) * -hip + local pos_z = math.cos(yaw) * hip obj_pos.x = pos.x + pos_x obj_pos.z = pos.z + pos_z diff --git a/lib_planes/entities.lua b/lib_planes/entities.lua index 0bb713d..c959901 100644 --- a/lib_planes/entities.lua +++ b/lib_planes/entities.lua @@ -120,7 +120,7 @@ function airutils.on_step(self,dtime,colinfo) props.show_on_minimap = true self.object:set_properties(props) end - if self.isonground and props.show_on_minimap then + if self.isonground and props.show_on_minimap then props.show_on_minimap = false self.object:set_properties(props) end @@ -150,7 +150,7 @@ function airutils.on_step(self,dtime,colinfo) end local function ground_pitch(self, longit_speed, curr_pitch) - newpitch = curr_pitch + local newpitch = curr_pitch if self._last_longit_speed == nil then self._last_longit_speed = 0 end -- Estado atual do sistema @@ -621,7 +621,7 @@ local function damage_vehicle(self, toolcaps, ttime, damage) if (not toolcaps) then return end - value = toolcaps.damage_groups.fleshy or 0 + local value = toolcaps.damage_groups.fleshy or 0 if (toolcaps.damage_groups.vehicle) then value = toolcaps.damage_groups.vehicle end