FlightControl-Master / MOOSE

Mission Object Oriented Scripting Environment (MOOSE) for lua mission scripting design in DCS World
http://flightcontrol-master.github.io/MOOSE/
GNU General Public License v3.0
292 stars 94 forks source link

two bugs in PATHLINE #2096

Closed derbuur closed 6 months ago

derbuur commented 6 months ago

Hi, I found two bugs in PATHLINE.

  1. In the function PATHLINE:GetPointFromIndex(n) it must be self.points[n] instead of self.point[n]

    function PATHLINE:GetPointFromIndex(n)
    
    local N=self:GetNumberOfPoints()
    
    n=n or 1
    
    local point=nil --#PATHLINE.Point
    
    if n>=1 and n<=N then
    point=self.points[n] -- must be points not point
    else
    self:E(self.lid..string.format("ERROR: No point in pathline for N=%s", tostring(n)))
    end
    
    return point
    end
  2. in the function PATHLINE:GetCoordinats() is the table.insert misssing.

    function PATHLINE:GetCoordinats()
    
    local vecs={}
    
    for _,_point in pairs(self.points) do
    local point=_point --#PATHLINE.Point
    local coord=COORDINATE:NewFromVec3(point.vec3)
    table.insert(vecs, coord) -- this line was missing
    end
    
    return vecs
    end
Applevangelist commented 6 months ago

Fixed #2097