소스 검색

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);
         AZStd::string absolutePath = relativePath.substr(1);
         EBUS_EVENT(AzToolsFramework::AssetSystemRequestBus, GetFullSourcePathFromRelativeProductPath, absolutePath, absolutePath);
         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);
         //AZ_TracePrintf(LUAEditorDebugName, "Breakpoint '%s' was hit on line %i\n", assetIdString.c_str(), lineNumber);
         EBUS_EVENT(LUAEditorDebuggerMessages::Bus, GetCallstack);
         EBUS_EVENT(LUAEditorDebuggerMessages::Bus, GetCallstack);
         EBUS_EVENT(LUAEditor::LUABreakpointRequestMessages::Bus, RequestEditorFocus, absolutePath, lineNumber);
         EBUS_EVENT(LUAEditor::LUABreakpointRequestMessages::Bus, RequestEditorFocus, absolutePath, lineNumber);