Fixed: Lua bug with wander_destination_reached
This commit is contained in:
parent
f912706dfd
commit
aad6cd844b
1 changed files with 8 additions and 1 deletions
|
@ -2107,7 +2107,11 @@ Logic.translateActivityStep = function(context, hlComponent, activitySequence,
|
||||||
if Logic.isWanderActivity(activityStep.Activity) and activityStep.TimeLimit == "Few Sec" then
|
if Logic.isWanderActivity(activityStep.Activity) and activityStep.TimeLimit == "Few Sec" then
|
||||||
local event = r2.Translator.createEvent("destination_reached_all", aiState.Name, groupsByName)
|
local event = r2.Translator.createEvent("destination_reached_all", aiState.Name, groupsByName)
|
||||||
table.insert(context.RtAct.Events, event)
|
table.insert(context.RtAct.Events, event)
|
||||||
local action = r2.Translator.createAction("wander_destination_reached", groupsByName, aiState.Name,activityStepIndex , tonumber(activityStep.TimeLimitValue))
|
local number = tonumber(activityStep.TimeLimitValue)
|
||||||
|
if number == nil then
|
||||||
|
number = 0
|
||||||
|
end
|
||||||
|
local action = r2.Translator.createAction("wander_destination_reached", groupsByName, aiState.Name, activityStepIndex, number)
|
||||||
table.insert(context.RtAct.Actions, action)
|
table.insert(context.RtAct.Actions, action)
|
||||||
table.insert(event.ActionsId, action.Id)
|
table.insert(event.ActionsId, action.Id)
|
||||||
end
|
end
|
||||||
|
@ -2414,6 +2418,9 @@ Logic.getTimeLimit = function(step)
|
||||||
|
|
||||||
if step.TimeLimit == "Few Sec" then
|
if step.TimeLimit == "Few Sec" then
|
||||||
local limit = tonumber(step.TimeLimitValue)
|
local limit = tonumber(step.TimeLimitValue)
|
||||||
|
if limit == nil then
|
||||||
|
limit = 0
|
||||||
|
end
|
||||||
limit = 1 + limit * 10
|
limit = 1 + limit * 10
|
||||||
param = tostring( limit )
|
param = tostring( limit )
|
||||||
return param
|
return param
|
||||||
|
|
Loading…
Reference in a new issue