Fix more things

This commit is contained in:
SkyHasACat 2025-08-02 15:04:13 -07:00
parent a7f614dd54
commit c5684a4204
2 changed files with 1 additions and 18 deletions

View File

@ -6,20 +6,6 @@
#include <components/lua/luastate.hpp> #include <components/lua/luastate.hpp>
#include <components/misc/color.hpp> #include <components/misc/color.hpp>
namespace
{
struct RegionSoundRef
{
ESM::RefId mSoundId;
uint8_t mChance;
RegionSoundRef(const ESM::Region::SoundRef& ref)
: mSoundId(ref.mSound)
, mChance(ref.mChance)
{
}
};
}
namespace sol namespace sol
{ {
@ -53,9 +39,6 @@ namespace MWLua
= sol::readonly_property([](const ESM::Region::SoundRef& ref) { return ref.mSound.serializeText(); }); = sol::readonly_property([](const ESM::Region::SoundRef& ref) { return ref.mSound.serializeText(); });
soundRefT["chance"] = sol::readonly_property([](const ESM::Region::SoundRef& ref) { return ref.mChance; }); soundRefT["chance"] = sol::readonly_property([](const ESM::Region::SoundRef& ref) { return ref.mChance; });
soundRefT["sound"] = sol::readonly_property([](const ESM::Region::SoundRef& ref) -> const ESM::Sound* {
return MWBase::Environment::get().getESMStore()->get<ESM::Sound>().find(ref.mSound);
});
// Region record // Region record
auto regionT = lua.new_usertype<ESM::Region>("ESM3_Region"); auto regionT = lua.new_usertype<ESM::Region>("ESM3_Region");

View File

@ -1186,7 +1186,7 @@
-- Region sound reference -- Region sound reference
-- @type RegionSoundRef -- @type RegionSoundRef
-- @field #string soundId Sound record ID -- @field #string soundId Sound record ID
-- @field #number chance Probability (0100) that this sound plays periodically in the region -- @field #number chance Probability that this sound plays periodically in the region
-- @field #Sound sound The full sound record referenced by `soundId`, or `nil` if not found -- @field #Sound sound The full sound record referenced by `soundId`, or `nil` if not found
--- @{#Factions}: Factions --- @{#Factions}: Factions