diff --git a/CMakeLists.txt b/CMakeLists.txt index 7b7e8de656..d7571dbc1e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -82,7 +82,7 @@ message(STATUS "Configuring OpenMW...") set(OPENMW_VERSION_MAJOR 0) set(OPENMW_VERSION_MINOR 51) set(OPENMW_VERSION_RELEASE 0) -set(OPENMW_LUA_API_REVISION 107) +set(OPENMW_LUA_API_REVISION 108) set(OPENMW_POSTPROCESSING_API_REVISION 4) set(OPENMW_VERSION_COMMITHASH "") diff --git a/apps/esmtool/record.cpp b/apps/esmtool/record.cpp index 3e45b6eead..982e16193a 100644 --- a/apps/esmtool/record.cpp +++ b/apps/esmtool/record.cpp @@ -750,7 +750,7 @@ namespace EsmTool std::cout << " Attribute2 Requirement: " << mData.mData.mRankData[i].mAttribute2 << std::endl; std::cout << " One Skill at Level: " << mData.mData.mRankData[i].mPrimarySkill << std::endl; std::cout << " Two Skills at Level: " << mData.mData.mRankData[i].mFavouredSkill << std::endl; - std::cout << " Faction Reaction: " << mData.mData.mRankData[i].mFactReaction << std::endl; + std::cout << " Faction Reputation: " << mData.mData.mRankData[i].mFactReputation << std::endl; } for (const auto& reaction : mData.mReactions) std::cout << " Reaction: " << reaction.second << " = " << reaction.first << std::endl; diff --git a/apps/opencs/model/world/nestedcoladapterimp.cpp b/apps/opencs/model/world/nestedcoladapterimp.cpp index 185ebd7e4c..10083fcb05 100644 --- a/apps/opencs/model/world/nestedcoladapterimp.cpp +++ b/apps/opencs/model/world/nestedcoladapterimp.cpp @@ -1135,7 +1135,7 @@ namespace CSMWorld case 4: return rankData.mFavouredSkill; case 5: - return rankData.mFactReaction; + return rankData.mFactReputation; default: throw std::runtime_error("Rank subcolumn index out of range"); } @@ -1166,7 +1166,7 @@ namespace CSMWorld rankData.mFavouredSkill = value.toInt(); break; case 5: - rankData.mFactReaction = value.toInt(); + rankData.mFactReputation = value.toInt(); break; default: throw std::runtime_error("Rank index out of range"); diff --git a/apps/openmw/mwdialogue/filter.cpp b/apps/openmw/mwdialogue/filter.cpp index 4b42d67a03..95c38671db 100644 --- a/apps/openmw/mwdialogue/filter.cpp +++ b/apps/openmw/mwdialogue/filter.cpp @@ -708,7 +708,7 @@ bool MWDialogue::Filter::hasFactionRankReputationRequirements( const ESM::Faction& faction = *MWBase::Environment::get().getESMStore()->get().find(factionId); - return stats.getFactionReputation(factionId) >= faction.mData.mRankData.at(rank).mFactReaction; + return stats.getFactionReputation(factionId) >= faction.mData.mRankData.at(rank).mFactReputation; } MWDialogue::Filter::Filter(const MWWorld::Ptr& actor, int choice, bool talkedToPlayer) diff --git a/apps/openmw/mwlua/factionbindings.cpp b/apps/openmw/mwlua/factionbindings.cpp index 45234827de..a6418ff9b9 100644 --- a/apps/openmw/mwlua/factionbindings.cpp +++ b/apps/openmw/mwlua/factionbindings.cpp @@ -99,9 +99,15 @@ namespace MWLua }; rankT["name"] = sol::readonly_property([](const FactionRank& rec) -> std::string_view { return rec.mRankName; }); - rankT["primarySkillValue"] = sol::readonly_property([](const FactionRank& rec) { return rec.mPrimarySkill; }); - rankT["favouredSkillValue"] = sol::readonly_property([](const FactionRank& rec) { return rec.mFavouredSkill; }); - rankT["factionReaction"] = sol::readonly_property([](const FactionRank& rec) { return rec.mFactReaction; }); + rankT["primarySkillValue"] + = sol::readonly_property([](const FactionRank& rec) -> int { return rec.mPrimarySkill; }); + rankT["favouredSkillValue"] + = sol::readonly_property([](const FactionRank& rec) -> int { return rec.mFavouredSkill; }); + rankT["factionReputation"] + = sol::readonly_property([](const FactionRank& rec) -> int { return rec.mFactReputation; }); + // deprecated + rankT["factionReaction"] + = sol::readonly_property([](const FactionRank& rec) -> int { return rec.mFactReputation; }); rankT["attributeValues"] = sol::readonly_property([lua = lua.lua_state()](const FactionRank& rec) { sol::table res(lua, sol::create); res.add(rec.mAttribute1); diff --git a/components/esm3/loadfact.cpp b/components/esm3/loadfact.cpp index 1dd1fe1a0e..18ad811b1f 100644 --- a/components/esm3/loadfact.cpp +++ b/components/esm3/loadfact.cpp @@ -23,7 +23,7 @@ namespace ESM esm.getT(mAttribute2); esm.getT(mPrimarySkill); esm.getT(mFavouredSkill); - esm.getT(mFactReaction); + esm.getT(mFactReputation); } void RankData::save(ESMWriter& esm) const @@ -32,7 +32,7 @@ namespace ESM esm.writeT(mAttribute2); esm.writeT(mPrimarySkill); esm.writeT(mFavouredSkill); - esm.writeT(mFactReaction); + esm.writeT(mFactReputation); } void Faction::FADTstruct::load(ESMReader& esm) @@ -160,7 +160,7 @@ namespace ESM { mData.mRankData[i].mAttribute1 = mData.mRankData[i].mAttribute2 = 0; mData.mRankData[i].mPrimarySkill = mData.mRankData[i].mFavouredSkill = 0; - mData.mRankData[i].mFactReaction = 0; + mData.mRankData[i].mFactReputation = 0; mRanks[i].clear(); } diff --git a/components/esm3/loadfact.hpp b/components/esm3/loadfact.hpp index eef2126514..f0fdd4e3da 100644 --- a/components/esm3/loadfact.hpp +++ b/components/esm3/loadfact.hpp @@ -29,7 +29,7 @@ namespace ESM // 'mFavouredSkill' to advance to this rank. int32_t mPrimarySkill, mFavouredSkill; - int32_t mFactReaction; // Reaction from faction members + int32_t mFactReputation; // Required faction rep void load(ESMReader& esm); void save(ESMWriter& esm) const; diff --git a/files/lua_api/openmw/core.lua b/files/lua_api/openmw/core.lua index 2f7564d3ef..91d064a9b5 100644 --- a/files/lua_api/openmw/core.lua +++ b/files/lua_api/openmw/core.lua @@ -1220,7 +1220,8 @@ -- @field #list<#number> attributeValues Attributes values required to get this rank. -- @field #number primarySkillValue Primary skill value required to get this rank. -- @field #number favouredSkillValue Secondary skill value required to get this rank. --- @field #number factionReaction Reaction of faction members if player is in this faction. +-- @field #number factionReputation Required amount of faction reputation to reach this rank. +-- @field #number factionReaction (DEPRECATED) Returns the same as factionReputation. --- @{#MWScripts}: MWScripts -- @field [parent=#core] #MWScript mwscripts