Browse Source

Add edge case check for luac during breakpoint eval

Signed-off-by: puvvadar <[email protected]>
puvvadar 3 years ago
parent
commit
a0da4df47a
1 changed files with 7 additions and 0 deletions
  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);