浏览代码

Add edge case check for luac during breakpoint eval

Signed-off-by: puvvadar <[email protected]>
puvvadar 3 年之前
父节点
当前提交
a0da4df47a
共有 1 个文件被更改,包括 7 次插入0 次删除
  1. 7 0
      Code/Tools/LuaIDE/Source/LUA/LUAEditorContext.cpp

+ 7 - 0
Code/Tools/LuaIDE/Source/LUA/LUAEditorContext.cpp

@@ -1800,6 +1800,13 @@ namespace LUAEditor
         AZStd::string absolutePath = relativePath.substr(1);
         EBUS_EVENT(AzToolsFramework::AssetSystemRequestBus, GetFullSourcePathFromRelativeProductPath, absolutePath, absolutePath);
 
+        // If finding a .lua fails, attempt the equivalent .luac
+        if (absolutePath.empty() && relativePath.ends_with(".lua"))
+        {
+            absolutePath = relativePath.substr(1) + "c";
+            EBUS_EVENT(AzToolsFramework::AssetSystemRequestBus, GetFullSourcePathFromRelativeProductPath, absolutePath, absolutePath); 
+        }
+
         //AZ_TracePrintf(LUAEditorDebugName, "Breakpoint '%s' was hit on line %i\n", assetIdString.c_str(), lineNumber);
         EBUS_EVENT(LUAEditorDebuggerMessages::Bus, GetCallstack);
         EBUS_EVENT(LUAEditor::LUABreakpointRequestMessages::Bus, RequestEditorFocus, absolutePath, lineNumber);