lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


My game calls in each frame some Lua functions. One of reason to use Lua is
that I can change behaviour of game without recompiling, and even without
restarting it. When I change something in file with function I just load that
file again, with following code:

int result=luaL_loadfile(L,filename);
(...)
int result=lua_pcall(L,0,0,0);

Do I lose something this way? When I run script once it puts function
definition somewhere, what happen if I run script second time? Is any memory
lost? Is function defined once or twice?

-- 
Free Software - find interesting programs and change them
NetHack - meet interesting creatures, kill them and eat their bodies
Usenet - meet interesting people from all over the world and flame them
Decopter - unrealistic helicopter simulator, get it from http://decopter.sf.net