diff options
| author | Alexander Gavrilov | 2012-08-19 17:53:25 +0400 |
|---|---|---|
| committer | Alexander Gavrilov | 2012-08-19 17:53:25 +0400 |
| commit | cacb082416667ec4309d85e934068ded041d21b8 (patch) | |
| tree | f34c045461dfea3c4a5054d90b4042050bf9857f /library/modules | |
| parent | 30f71ff5106d271d04bfa26b976441cfa9b2abf6 (diff) | |
| download | dfhack-cacb082416667ec4309d85e934068ded041d21b8.tar.gz dfhack-cacb082416667ec4309d85e934068ded041d21b8.tar.bz2 dfhack-cacb082416667ec4309d85e934068ded041d21b8.tar.xz | |
Add a stupid example of a lua-controlled viewscreen.
Diffstat (limited to 'library/modules')
| -rw-r--r-- | library/modules/Screen.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/library/modules/Screen.cpp b/library/modules/Screen.cpp index ac45bb86..ba0313e2 100644 --- a/library/modules/Screen.cpp +++ b/library/modules/Screen.cpp @@ -318,6 +318,9 @@ int dfhack_lua_viewscreen::do_destroy(lua_State *L) lua_setfield(L, -2, "_native"); lua_getfield(L, -1, "onDestroy"); + if (lua_isnil(L, -1)) + return 0; + lua_pushvalue(L, -2); lua_call(L, 1, 0); return 0; |
