mirror of
https://github.com/0O0o0oOoO00/Alas.git
synced 2026-05-14 12:59:25 +08:00
fix: check args count of Chapter.getConfig
This commit is contained in:
@@ -376,10 +376,12 @@ void Cracker::update_fake_player_info(const FakePlayerInfo& fake_info) {
|
||||
void Cracker::enable_remove_hard_mode_ship_type_limit() {
|
||||
m_state["Chapter"]["getConfig"] = [this](sol::this_state L, Lua::VariadicArgs args) -> Lua::Object {
|
||||
CALLED(Chapter.getConfig);
|
||||
Lua::Object first_arg = args[1];
|
||||
bool limitation = false;
|
||||
if (first_arg.get_type() == sol::type::string && first_arg.as<std::string>() == "limitation") {
|
||||
limitation = true;
|
||||
if (args.size() == 2) {
|
||||
Lua::Object first_arg = args[1];
|
||||
if (first_arg.get_type() == sol::type::string && first_arg.as<std::string>() == "limitation") {
|
||||
limitation = true;
|
||||
}
|
||||
}
|
||||
|
||||
Lua::Object res = m_original.Chapter_getConfig(args);
|
||||
|
||||
Reference in New Issue
Block a user