Speedmax returning 0 not nil

This commit is contained in:
Applevangelist 2021-10-30 16:33:14 +02:00
parent 98c6c88391
commit 18745158a3

View File

@ -568,12 +568,12 @@ function GROUP:GetSpeedMax()
local Units=self:GetUnits()
local speedmax=nil
local speedmax=0
for _,unit in pairs(Units) do
local unit=unit --Wrapper.Unit#UNIT
local speed=unit:GetSpeedMax()
if speedmax==nil then
if speedmax==0 then
speedmax=speed
elseif speed<speedmax then
speedmax=speed