disable debugging if server is not running & make detach complete

This commit is contained in:
MihailRis
2025-10-09 01:14:49 +03:00
parent 1a7bcf9865
commit d861595f78
2 changed files with 53 additions and 33 deletions
@@ -376,6 +376,10 @@ static int l_debug_pull_events(lua::State* L) {
return 1;
}
static int l_debug_is_debugging(lua::State* L) {
return lua::pushboolean(L, engine->getDebuggingServer() != nullptr);
}
void initialize_libs_extends(lua::State* L) {
if (lua::getglobal(L, "debug")) {
lua::pushcfunction(L, lua::wrap<l_debug_error>);
@@ -399,6 +403,9 @@ void initialize_libs_extends(lua::State* L) {
lua::pushcfunction(L, lua::wrap<l_debug_sendvalue>);
lua::setfield(L, "__sendvalue");
lua::pushcfunction(L, lua::wrap<l_debug_is_debugging>);
lua::setfield(L, "is_debugging");
lua::pop(L);
}
if (lua::getglobal(L, "math")) {