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 | |
parent | 6da6afe8ad3ffc3d690af9b60975c5f183f2aba8 (diff) | |
download | manaserv-4d88724f011090de417284668d2264931f1bfcc3.tar.gz manaserv-4d88724f011090de417284668d2264931f1bfcc3.tar.bz2 manaserv-4d88724f011090de417284668d2264931f1bfcc3.tar.xz manaserv-4d88724f011090de417284668d2264931f1bfcc3.zip |
Added bind for setting login callback
Reviewed-by: bjorn.
Diffstat (limited to 'src/scripting')
-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 7ec7e053..51ebaa5e 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 }, |