diff options
| author | Erik Schilling <ablu.erikschilling@googlemail.com> | 2012-07-08 17:20:34 +0200 |
|---|---|---|
| committer | Erik Schilling <ablu.erikschilling@googlemail.com> | 2012-07-08 17:54:57 +0200 |
| commit | 4d88724f011090de417284668d2264931f1bfcc3 (patch) | |
| tree | 94e2783c3f588e43663d7307730bc21dc46a64c9 /src/scripting/lua.cpp | |
| parent | 6da6afe8ad3ffc3d690af9b60975c5f183f2aba8 (diff) | |
Added bind for setting login callback
Reviewed-by: bjorn.
Diffstat (limited to 'src/scripting/lua.cpp')
| -rw-r--r-- | src/scripting/lua.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/scripting/lua.cpp b/src/scripting/lua.cpp index 7ec7e05..51ebaa5 100644 --- a/src/scripting/lua.cpp +++ b/src/scripting/lua.cpp @@ -92,6 +92,13 @@ static int on_character_death_accept(lua_State *s) return 0; } +static int on_character_login(lua_State *s) +{ + luaL_checktype(s, 1, LUA_TFUNCTION); + Character::setLoginCallback(getScript(s)); + return 0; +} + static int on_being_death(lua_State *s) { luaL_checktype(s, 1, LUA_TFUNCTION); @@ -2367,6 +2374,7 @@ LuaScript::LuaScript(): static luaL_Reg const callbacks[] = { { "on_character_death", &on_character_death }, { "on_character_death_accept", &on_character_death_accept }, + { "on_character_login", &on_character_login }, { "on_being_death", &on_being_death }, { "on_being_remove", &on_being_remove }, { "on_update", &on_update }, |
