Skip to content

Commit

Permalink
fixed lua console - run on entity
Browse files Browse the repository at this point in the history
  • Loading branch information
nem0 committed Nov 19, 2024
1 parent 626f3ee commit 79ba915
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion data/editor/scripts/plugins/lua_console.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function execute()
for i = 1, selected_count do
local entity = Editor.getSelectedEntity(i - 1)
if entity.lua_script == nil then continue end
local env = entity.lua_script[0]
local env = entity.lua_script[1]
if env ~= nil then
setfenv(f, env)
f()
Expand Down
2 changes: 1 addition & 1 deletion data/editor/scripts/plugins/open_script_action.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Editor.addAction {
run = function()
if Editor.getSelectedEntitiesCount() ~= 1 then return end
local e = Editor.getSelectedEntity(0)
if e.lua_script[0] == nil then return end
if e.lua_script[1] == nil then return end
local script_path = e.lua_script:getScriptPath(0)
Editor.asset_browser:openEditor(script_path)
end
Expand Down

0 comments on commit 79ba915

Please sign in to comment.