diff --git a/blcrack/cracker/cracker.cpp b/blcrack/cracker/cracker.cpp index 933acde56..e514dfead 100644 --- a/blcrack/cracker/cracker.cpp +++ b/blcrack/cracker/cracker.cpp @@ -904,6 +904,19 @@ void Cracker::hook_all_lua_functions() { CALLED(NewBattleResultScene.SetUp); if (IS_ENABLED(SKIP_BATTLE_RESULT)) { + if (IS_ENABLED(AUTO_RETIRE)) { + Lua::Object retire_timer = m_lua_res.Timer_New(L, [this](sol::this_state l, Lua::VariadicArgs ags) { + std::optional playerProxy = m_lua_res.getProxy(l, m_lua_res.PlayerProxy); + std::optional bayProcy = m_lua_res.getProxy(l, m_lua_res.BayProxy); + + if (playerProxy.has_value() && playerProxy->get_type() != sol::type::nil && bayProcy.has_value() && bayProcy->get_type() != sol::type::nil) { + execute_retire_ship(l, ags); + } + + }, 1.5, 1); + m_lua_res.Timer_Start(L, retire_timer); + } + Lua::Object self = args[0]; m_lua_res.NewBattleResultScene_GoBack(L, self); return;