jakubg1 / OpenSMCE

Game engine which allows creating a broad range of marble popper games.
MIT License
14 stars 11 forks source link

Use setfenv in UI scripts #101

Open jakubg1 opened 1 year ago

jakubg1 commented 1 year ago

Instead of this (main.lua):

-- Remove all potentially malicious OS functions, to prevent any external scripts
-- from causing damage by, for example, loading a game with a os.execute("format c:") line
-- in its UI script.

os = {
    time = os.time,
    date = os.date
}

it would be better to use a Lua's setfenv method.