mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-09-14 15:00:18 -04: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:
commit
d87d4b26f9
@ -22,16 +22,18 @@ local function startPackage(args)
|
|||||||
local key = "idle"
|
local key = "idle"
|
||||||
local idle = {}
|
local idle = {}
|
||||||
local duration = 0
|
local duration = 0
|
||||||
for i = 2, 9 do
|
if args.idle then
|
||||||
local val = args.idle[key .. i]
|
for i = 2, 9 do
|
||||||
if val == nil then
|
local val = args.idle[key .. i]
|
||||||
idle[i-1] = 0
|
if val == nil then
|
||||||
else
|
idle[i-1] = 0
|
||||||
local v = tonumber(val) or 0
|
else
|
||||||
if v < 0 or v > 100 then
|
local v = tonumber(val) or 0
|
||||||
error("idle values cannot exceed 100")
|
if v < 0 or v > 100 then
|
||||||
|
error("idle values cannot exceed 100")
|
||||||
|
end
|
||||||
|
idle[i-1] = v
|
||||||
end
|
end
|
||||||
idle[i-1] = v
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if args.duration then
|
if args.duration then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user