mirror of
https://github.com/0O0o0oOoO00/Alas.git
synced 2026-05-14 12:59:25 +08:00
fix: do AUTO_RETIRE before SKIP_SHIP_GAIN_SHOW to avoid incorrect process flow when the game undergoes battle settlement
This commit is contained in:
@@ -1093,20 +1093,7 @@ 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);
|
||||
@@ -1118,6 +1105,12 @@ void Cracker::hook_all_lua_functions() {
|
||||
}, 1.5, 1);
|
||||
m_lua_res.Timer_Start(L, retire_timer);
|
||||
}
|
||||
if (enabled_SKIP_SHIP_GAIN_SHOW) {
|
||||
Lua::Function callback = args[2];
|
||||
callback(L);
|
||||
} else {
|
||||
m_original.NewBattleResultDisplayAwardPage_ShowShips(L, args);
|
||||
}
|
||||
};
|
||||
|
||||
m_state["BaseUI"]["emit"] = [this](sol::this_state L, Lua::VariadicArgs args) {
|
||||
|
||||
Reference in New Issue
Block a user