From 450f907166a55fb6919c0882029dbd757e650b2c Mon Sep 17 00:00:00 2001 From: Evil Eye Date: Thu, 14 Aug 2025 14:01:15 +0200 Subject: [PATCH] Adjust documentation and bump API revision --- CMakeLists.txt | 2 +- apps/openmw/mwlua/regionbindings.cpp | 2 +- files/lua_api/openmw/core.lua | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b43740b283..9d81a67f26 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -82,7 +82,7 @@ message(STATUS "Configuring OpenMW...") set(OPENMW_VERSION_MAJOR 0) set(OPENMW_VERSION_MINOR 50) set(OPENMW_VERSION_RELEASE 0) -set(OPENMW_LUA_API_REVISION 91) +set(OPENMW_LUA_API_REVISION 92) set(OPENMW_POSTPROCESSING_API_REVISION 3) set(OPENMW_VERSION_COMMITHASH "") diff --git a/apps/openmw/mwlua/regionbindings.cpp b/apps/openmw/mwlua/regionbindings.cpp index 500c390b9c..1f0e85a5e3 100644 --- a/apps/openmw/mwlua/regionbindings.cpp +++ b/apps/openmw/mwlua/regionbindings.cpp @@ -55,7 +55,7 @@ namespace MWLua const MWWorld::Weather* weather = MWBase::Environment::get().getWorld()->getWeather(i); res[weather->mId.serializeText()] = rec.mData.mProbabilities[i]; } - return res; + return LuaUtil::makeReadOnly(res); }); regionT["sounds"] = sol::readonly_property([lua = lua.lua_state()](const ESM::Region& rec) { sol::table res(lua, sol::create); diff --git a/files/lua_api/openmw/core.lua b/files/lua_api/openmw/core.lua index 61d334beec..a7f8d5e8f1 100644 --- a/files/lua_api/openmw/core.lua +++ b/files/lua_api/openmw/core.lua @@ -1172,13 +1172,13 @@ -- @type RegionRecord -- @field #string id Region ID -- @field #string name Region display name --- @field openmw.util#Color mapColor Map color for this region. +-- @field openmw.util#Color mapColor Editor map color for this region. -- @field #string sleepList A leveled creature list used when sleeping outdoors in this region -- @field #list<#RegionSoundRef> sounds A read-only list of ambient sound references for this region. -- Each reference includes a chance and a resolved link to the full sound record. --- @field #table weatherProbabilities A table mapping weather ids to their probability (0–100), should sum to 100. +-- @field #table weatherProbabilities A table mapping @{#WeatherRecord.recordId}s to their probability (0–100), should sum to 100. -- Valid weather ids include: --- `"clear"`, `"cloudy"`, `"foggy"`, `"overcast"`, `"rain"`, `"thunder"`, `"ash"`, `"blight"`, `"snow"`, `"blizzard"` +-- `"clear"`, `"cloudy"`, `"foggy"`, `"overcast"`, `"rain"`, `"thunderstorm"`, `"ashstorm"`, `"blight"`, `"snow"`, `"blizzard"` -- @usage print(region.weatherProbabilities["rain"]) ---