1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-28 03:40:04 +00:00

Merge branch 'ai-exposed-addendum' into 'master'

Idle is optional and could be nil

See merge request OpenMW/openmw!4074
This commit is contained in:
Alexei Kotov 2024-05-05 10:56:17 +00:00
commit d87d4b26f9

View File

@ -22,16 +22,18 @@ local function startPackage(args)
local key = "idle"
local idle = {}
local duration = 0
for i = 2, 9 do
local val = args.idle[key .. i]
if val == nil then
idle[i-1] = 0
else
local v = tonumber(val) or 0
if v < 0 or v > 100 then
error("idle values cannot exceed 100")
if args.idle then
for i = 2, 9 do
local val = args.idle[key .. i]
if val == nil then
idle[i-1] = 0
else
local v = tonumber(val) or 0
if v < 0 or v > 100 then
error("idle values cannot exceed 100")
end
idle[i-1] = v
end
idle[i-1] = v
end
end
if args.duration then