Merge branch 'main' into dev

This commit is contained in:
MihailRis 2026-04-11 23:40:37 +03:00
commit 767fa7c7a9
10 changed files with 51 additions and 31 deletions

View file

@ -321,7 +321,10 @@ static void reconfig_packs_outside(
}
for (const auto& id : packsToRemove) {
manager.exclude(id);
names.erase(std::find(names.begin(), names.end(), id));
auto it = std::find(names.begin(), names.end(), id);
if (it != names.end()) {
names.erase(it);
}
}
names = manager.assemble(names);
contentControl.setContentPacksRaw(manager.getAll(names));

View file

@ -8,7 +8,7 @@ inline const char* DEFAULT_CHANNEL = "regular";
inline int extract_channel_index(lua::State* L, int idx) {
const char* channel = DEFAULT_CHANNEL;
if (!lua::isnoneornil(L, idx)) {
if (lua::isstring(L, idx)) {
channel = lua::tostring(L, idx);
}
int index = audio::get_channel_index(channel);
@ -121,7 +121,7 @@ static int l_audio_play_stream(lua::State* L) {
return lua::pushinteger(
L,
static_cast<lua::Integer>(play_stream(
lua::tostring(L, 1),
lua::require_string(L, 1),
false,
lua::tonumber(L, 2),
lua::tonumber(L, 3),
@ -144,7 +144,7 @@ static int l_audio_play_stream_2d(lua::State* L) {
return lua::pushinteger(
L,
static_cast<lua::Integer>(play_stream(
lua::tostring(L, 1),
lua::require_string(L, 1),
true,
0.0,
0.0,
@ -170,7 +170,7 @@ static int l_audio_play_sound(lua::State* L) {
return lua::pushinteger(
L,
static_cast<lua::Integer>(play_sound(
lua::tostring(L, 1),
lua::require_string(L, 1),
false,
lua::tonumber(L, 2),
lua::tonumber(L, 3),
@ -193,7 +193,7 @@ static int l_audio_play_sound_2d(lua::State* L) {
return lua::pushinteger(
L,
static_cast<lua::Integer>(play_sound(
lua::tostring(L, 1),
lua::require_string(L, 1),
true,
0.0,
0.0,