1
0
mirror of https://github.com/0O0o0oOoO00/Alas.git synced 2026-05-14 12:59:25 +08:00

fix: do callback when only AUTO-RETIRE is enabled

This commit is contained in:
0O0o0oOoO00
2026-01-23 12:28:40 +08:00
parent 7220c5bad3
commit 6d63761da2

View File

@@ -1010,11 +1010,20 @@ void Cracker::hook_all_lua_functions() {
return;
}
bool callback_called = false;
if (enabled_SKIP_SHIP_GAIN_SHOW) {
Lua::Function callback = args[2];
callback(L);
callback_called = true;
}
if (enabled_AUTO_RETIRE) {
if (!callback_called) {
Lua::Function callback = args[2];
callback(L);
callback_called = true;
}
Lua::Object retire_timer = m_lua_res.Timer_New(L, [this](sol::this_state l, Lua::VariadicArgs ags) {
std::optional<Lua::Object> playerProxy = m_lua_res.getProxy(l, m_lua_res.PlayerProxy);
std::optional<Lua::Object> bayProcy = m_lua_res.getProxy(l, m_lua_res.BayProxy);