mirror of
https://github.com/0O0o0oOoO00/Alas.git
synced 2026-05-14 07:39:25 +08:00
fix: do AUTO_RETIRE before SKIP_BATTLE_RESULT
This commit is contained in:
@@ -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<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);
|
||||
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user