Skip to content

Commit

Permalink
Merge pull request GmodStarfall#64 from MechWipf/develop
Browse files Browse the repository at this point in the history
fixed pcall catching quota errors
  • Loading branch information
Xandaros committed Feb 17, 2014
2 parents f6d3b2e + 05cfd8a commit 8f822d6
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lua/starfall/libs_sh/builtins.lua
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,16 @@ function SF.DefaultEnvironment.dofile(file)
end

--- Lua's pcall function
SF.DefaultEnvironment.pcall = pcall
function SF.DefaultEnvironment.pcall ( ... )
ok, err = pcall( ... )

-- don't catch quota errors
if SF.instance.ops > SF.instance.context.ops then
error( err, 0 )
end

return ok, err
end

--- GLua's loadstring, modified for safe use in Starfall
-- Works like loadstring, except that it executes by default in the main environment
Expand Down

0 comments on commit 8f822d6

Please sign in to comment.