From 3559c033960301c8dad912425bb2681d0828b985 Mon Sep 17 00:00:00 2001 From: Mr-Auto <36127424+Mr-Auto@users.noreply.github.com> Date: Sat, 14 Oct 2023 21:59:13 +0200 Subject: [PATCH] this works, for me at leats --- src/game_api/script/sol_helper.hpp | 2 +- src/game_api/script/usertypes/sound_lua.cpp | 13 ++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/game_api/script/sol_helper.hpp b/src/game_api/script/sol_helper.hpp index 2dc6a596d..d50334f27 100644 --- a/src/game_api/script/sol_helper.hpp +++ b/src/game_api/script/sol_helper.hpp @@ -76,7 +76,7 @@ struct usertype_container> static int size(lua_State* L) { ZeroIndexArray& v = sol::stack::get&>(L, 1); - return stack::push(L, v.size()); + return sol::stack::push(L, v.size()); } // Used by default implementation static auto begin(lua_State*, ZeroIndexArray& self) diff --git a/src/game_api/script/usertypes/sound_lua.cpp b/src/game_api/script/usertypes/sound_lua.cpp index 6514c6aa8..29976615a 100644 --- a/src/game_api/script/usertypes/sound_lua.cpp +++ b/src/game_api/script/usertypes/sound_lua.cpp @@ -162,11 +162,6 @@ void register_usertypes(sol::state& lua, SoundManager* sound_manager) "set_parameter", &PlayingSound::set_parameter); - auto left_channel = sol::property([&lua](SoundMeta* sm) - { return ZeroIndexArray(sm->left_channel); }); - auto right_channel = sol::property([](SoundMeta* sm) - { return ZeroIndexArray(sm->right_channel); }); - lua.new_usertype( "SoundMeta", "x", @@ -174,9 +169,13 @@ void register_usertypes(sol::state& lua, SoundManager* sound_manager) "y", &SoundMeta::y, "left_channel", - left_channel, + //&SoundMeta::left_channel, + sol::property([](SoundMeta* sm) + { return ZeroIndexArray(sm->left_channel) /**/; }), "right_channel", - right_channel, + //&SoundMeta::right_channel, + sol::property([](SoundMeta* sm) + { return ZeroIndexArray(sm->right_channel) /**/; }), "start_over", &SoundMeta::start_over, "playing",