diff --git a/code/ryzom/client/src/far_tp.cpp b/code/ryzom/client/src/far_tp.cpp index 2fb3f0c37..4f48d2ff5 100644 --- a/code/ryzom/client/src/far_tp.cpp +++ b/code/ryzom/client/src/far_tp.cpp @@ -1132,7 +1132,7 @@ void CFarTP::disconnectFromPreviousShard() */ NetMngr.reinit(); - if (isIngame()) + if (isIngame() && !isReselectingChar()) { nlinfo("FarTP: calling EntitiesMngr.reinit()"); EntitiesMngr.reinit(); diff --git a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp index fe4c6a716..996bd698a 100644 --- a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp +++ b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp @@ -1931,6 +1931,7 @@ void CLuaIHMRyzom::rawDebugInfo(const std::string &dbg) #endif pIM->displaySystemInfo( LuaHelperStuff::formatLuaErrorSysInfo(dbg)); } + nldebug("LUA: '%s'", dbg.c_str()); } diff --git a/code/ryzom/common/data_common/r2/r2_core_user_component_manager.lua b/code/ryzom/common/data_common/r2/r2_core_user_component_manager.lua index 6769d503b..4aa445484 100644 --- a/code/ryzom/common/data_common/r2/r2_core_user_component_manager.lua +++ b/code/ryzom/common/data_common/r2/r2_core_user_component_manager.lua @@ -1116,7 +1116,7 @@ function userComponentManager:export(list, refX, refY, refZ) messageBox(i18n.get("uiR2EDInvalidName")) return end - if string.find(form.ComponentFileName, '\.lua', -4) == nil then + if string.find(form.ComponentFileName, '.lua', -4) == nil then form.ComponentFileName = form.ComponentFileName .. ".lua" end local refPosition = form.RefPosition diff --git a/code/ryzom/common/data_common/r2/r2_debug.lua b/code/ryzom/common/data_common/r2/r2_debug.lua index 6a63b5472..78501dcab 100644 --- a/code/ryzom/common/data_common/r2/r2_debug.lua +++ b/code/ryzom/common/data_common/r2/r2_debug.lua @@ -140,7 +140,8 @@ end function assert(cond) if not cond then - rawDebugInfo(colorTag(255, 0, 255) .. "ASSERTION FAILED !! ") + -- rawDebugInfo(colorTag(255, 0, 255) .. "ASSERTION FAILED !! ") + rawDebugInfo("@{FOFF}ASSERTION FAILED !! ") dumpCallStack(2); error("") end diff --git a/code/ryzom/common/data_common/r2/r2_logic.lua b/code/ryzom/common/data_common/r2/r2_logic.lua index 1ee35d562..d50a15faf 100644 --- a/code/ryzom/common/data_common/r2/r2_logic.lua +++ b/code/ryzom/common/data_common/r2/r2_logic.lua @@ -1679,7 +1679,7 @@ Logic.translateChatSequences = function (context, hlComponent, behavior, rtNpcGr event.Name = "activity_sequence_changed" table.insert(context.RtAct.Events, event) - local rtInitChatStep = r2.Translator.createAction("code", "oldChatStepVar = -1;\n" .. Logic.chatStepVar .." = 0;\n()setTimer(1, " ..Logic.chatTimerId .. ")\;\n") + local rtInitChatStep = r2.Translator.createAction("code", "oldChatStepVar = -1;\n" .. Logic.chatStepVar .." = 0;\n()setTimer(1, " ..Logic.chatTimerId .. ");\n") rtInitChatStep.Name = "init_chat_step" table.insert(context.RtAct.Actions, rtInitChatStep) table.insert(event.ActionsId, rtInitChatStep.Id) diff --git a/code/ryzom/common/data_common/r2/r2_misc.lua b/code/ryzom/common/data_common/r2/r2_misc.lua index ee9e2885e..f3c9fa865 100644 --- a/code/ryzom/common/data_common/r2/r2_misc.lua +++ b/code/ryzom/common/data_common/r2/r2_misc.lua @@ -32,9 +32,8 @@ end -- extension to table library : remove all content of a table without deleting the table object function table.clear(tbl) while next(tbl) do - tbl[next(tbl)] = nil + table.remove(tbl, next(tbl)) end - table.setn(tbl, 0) end ------------------------------------------------------------------------------------------------------------ @@ -174,6 +173,17 @@ end function strify(str) return [["]] .. tostring(str) .. [["]] end + +------------------------------------------------------------------------------------------------- +-- enclose a string by double quotes +function strifyXml(str) + strxml = string.gsub(str, ">", ">") + strxml = string.gsub(strxml, "<", "<") + strxml = string.gsub(strxml, "&", "&") + strxml = string.gsub(strxml, "'", "'") + strxml = string.gsub(strxml, '"', """) + return [["]] .. tostring(strxml) .. [["]] +end ------------------------------------------------------------------------------------------------------------ -- snap a position to ground, returning the z snapped coordinate diff --git a/code/ryzom/common/data_common/r2/r2_ui_forms.lua b/code/ryzom/common/data_common/r2/r2_ui_forms.lua index ae1b4d656..587581f26 100644 --- a/code/ryzom/common/data_common/r2/r2_ui_forms.lua +++ b/code/ryzom/common/data_common/r2/r2_ui_forms.lua @@ -328,7 +328,7 @@ end local function saveScenarioOnChange(formInstance) r2.print(formInstance.Name) - local name = string.gsub(formInstance.Name, "[\\\/\:\*\?\"\<\>\|]", "_") + local name = string.gsub(formInstance.Name, "[\\/:*?\"<>|]", "_") if name ~= formInstance.Name then fromInstance.Name = name formInstance.Modified = true diff --git a/code/ryzom/common/data_common/r2/r2_ui_property_sheet.lua b/code/ryzom/common/data_common/r2/r2_ui_property_sheet.lua index 962eaf315..e4fbd4632 100644 --- a/code/ryzom/common/data_common/r2/r2_ui_property_sheet.lua +++ b/code/ryzom/common/data_common/r2/r2_ui_property_sheet.lua @@ -47,13 +47,13 @@ function r2:buildEditBox(prop, textRef, entryType, multiLine, maxNumChars, onCha bg_texture="grey_40.tga" onchange="lua" onchange_params="getUICaller():setupDisplayText(); getUICaller():find('edit_text'):updateCoords(); getUICaller():getEnclosingContainer().Env.updateSize()" onenter="lua" on_focus_lost="lua"]] .. - [[ id= ]] .. strify(prop.Name) .. - [[ text_ref = ]] .. strify(textRef) .. - [[ entry_type = ]] .. strify(entryType) .. - [[ multi_line = ]] .. strify(multiLine) .. - [[ max_num_chars = ]] .. strify(maxNumChars) .. - [[ params = ]] .. strify(onChangeAction) .. - [[ on_focus_lost_params = ]] .. strify(onFocusLostAction) .. + [[ id= ]] .. strifyXml(prop.Name) .. + [[ text_ref = ]] .. strifyXml(textRef) .. + [[ entry_type = ]] .. strifyXml(entryType) .. + [[ multi_line = ]] .. strifyXml(multiLine) .. + [[ max_num_chars = ]] .. strifyXml(maxNumChars) .. + [[ params = ]] .. strifyXml(onChangeAction) .. + [[ on_focus_lost_params = ]] .. strifyXml(onFocusLostAction) .. "/>" return result end @@ -73,13 +73,13 @@ end -- bg_texture="grey_40.tga" -- onchange="lua" onchange_params="getUICaller():setupDisplayText(); getUICaller():find('edit_text'):updateCoords(); getUICaller():getEnclosingContainer().Env.updateSize()" -- onenter="lua" on_focus_lost="lua"]] .. --- [[ id= ]] .. strify(prop.Name) .. --- [[ text_ref = ]] .. strify(textRef) .. --- [[ entry_type = ]] .. strify(entryType) .. --- [[ multi_line = ]] .. strify(multiLine) .. --- [[ max_num_chars = ]] .. strify(maxNumChars) .. --- [[ params = ]] .. strify(onChangeAction) .. --- [[ on_focus_lost_params = ]] .. strify(onChangeAction) .. +-- [[ id= ]] .. strifyXml(prop.Name) .. +-- [[ text_ref = ]] .. strifyXml(textRef) .. +-- [[ entry_type = ]] .. strifyXml(entryType) .. +-- [[ multi_line = ]] .. strifyXml(multiLine) .. +-- [[ max_num_chars = ]] .. strifyXml(maxNumChars) .. +-- [[ params = ]] .. strifyXml(onChangeAction) .. +-- [[ on_focus_lost_params = ]] .. strifyXml(onChangeAction) .. -- [[ /> -- -- @@ -1043,7 +1043,7 @@ r2.WidgetStyles.Number = width1 = tmp end - local part0 = [[