forked from github/server
added exception handling
This commit is contained in:
parent
b6b5b9709b
commit
e208a2ba8d
|
@ -36,8 +36,19 @@ call_spell(castorder *co)
|
|||
mage = co->familiar;
|
||||
}
|
||||
|
||||
try {
|
||||
return luabind::call_function<int>(luaState, fname, co->rt, mage, co->level, co->force);
|
||||
}
|
||||
catch (luabind::error& e) {
|
||||
lua_State* L = e.state();
|
||||
const char* error = lua_tostring(L, -1);
|
||||
|
||||
log_error((error));
|
||||
lua_pop(L, 1);
|
||||
std::terminate();
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
|
|
Loading…
Reference in New Issue