From e7d0bb4671fded682dd7f4f8ce0f3c1a5757d48f Mon Sep 17 00:00:00 2001 From: kervala Date: Wed, 10 Nov 2010 22:13:00 +0100 Subject: [PATCH] Fixed: Lua bug with wander_destination_reached --- code/ryzom/common/data_common/r2/r2_logic.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/code/ryzom/common/data_common/r2/r2_logic.lua b/code/ryzom/common/data_common/r2/r2_logic.lua index 5a83d5b43..904a3d98c 100644 --- a/code/ryzom/common/data_common/r2/r2_logic.lua +++ b/code/ryzom/common/data_common/r2/r2_logic.lua @@ -2107,7 +2107,11 @@ Logic.translateActivityStep = function(context, hlComponent, activitySequence, if Logic.isWanderActivity(activityStep.Activity) and activityStep.TimeLimit == "Few Sec" then local event = r2.Translator.createEvent("destination_reached_all", aiState.Name, groupsByName) 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(event.ActionsId, action.Id) end @@ -2414,6 +2418,9 @@ Logic.getTimeLimit = function(step) if step.TimeLimit == "Few Sec" then local limit = tonumber(step.TimeLimitValue) + if limit == nil then + limit = 0 + end limit = 1 + limit * 10 param = tostring( limit ) return param