mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-09 21:44:54 +00:00
Address feedback
This commit is contained in:
parent
967b5d205b
commit
f7be94aa21
@ -14,6 +14,7 @@
|
|||||||
#include <components/lua/l10n.hpp>
|
#include <components/lua/l10n.hpp>
|
||||||
#include <components/lua/luastate.hpp>
|
#include <components/lua/luastate.hpp>
|
||||||
#include <components/lua/utilpackage.hpp>
|
#include <components/lua/utilpackage.hpp>
|
||||||
|
#include <components/misc/strings/lower.hpp>
|
||||||
|
|
||||||
#include "../mwbase/environment.hpp"
|
#include "../mwbase/environment.hpp"
|
||||||
#include "../mwbase/statemanager.hpp"
|
#include "../mwbase/statemanager.hpp"
|
||||||
@ -157,15 +158,16 @@ namespace MWLua
|
|||||||
};
|
};
|
||||||
|
|
||||||
// TODO: deprecate this and provide access to the store instead
|
// TODO: deprecate this and provide access to the store instead
|
||||||
sol::table skill(context.mLua->sol(), sol::create);
|
sol::table skills(context.mLua->sol(), sol::create);
|
||||||
api["SKILL"] = LuaUtil::makeStrictReadOnly(skill);
|
api["SKILL"] = LuaUtil::makeStrictReadOnly(skills);
|
||||||
for (int i = 0; i < ESM::Skill::Length; ++i)
|
for (int i = 0; i < ESM::Skill::Length; ++i)
|
||||||
{
|
{
|
||||||
std::string id = ESM::Skill::indexToRefId(i).serializeText();
|
ESM::RefId skill = ESM::Skill::indexToRefId(i);
|
||||||
std::string key = id;
|
std::string id = skill.serializeText();
|
||||||
|
std::string key = Misc::StringUtils::lowerCase(skill.getRefIdString());
|
||||||
// force first character to uppercase for backwards compatability
|
// force first character to uppercase for backwards compatability
|
||||||
key[0] += 'A' - 'a';
|
key[0] += 'A' - 'a';
|
||||||
skill[key] = id;
|
skills[key] = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
sol::table attribute(context.mLua->sol(), sol::create);
|
sol::table attribute(context.mLua->sol(), sol::create);
|
||||||
|
@ -622,7 +622,7 @@ namespace MWLua
|
|||||||
|
|
||||||
if (rec->mData.mFlags & ESM::MagicEffect::TargetSkill)
|
if (rec->mData.mFlags & ESM::MagicEffect::TargetSkill)
|
||||||
{
|
{
|
||||||
ESM::RefId skill = ESM::RefId::stringRefId(argStr.value());
|
ESM::RefId skill = ESM::RefId::deserializeText(argStr.value());
|
||||||
key = MWMechanics::EffectKey(id, ESM::Skill::refIdToIndex(skill));
|
key = MWMechanics::EffectKey(id, ESM::Skill::refIdToIndex(skill));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -41,7 +41,7 @@ namespace
|
|||||||
book.mData.mValue = rec["value"];
|
book.mData.mValue = rec["value"];
|
||||||
book.mData.mIsScroll = rec["isScroll"];
|
book.mData.mIsScroll = rec["isScroll"];
|
||||||
|
|
||||||
ESM::RefId skill = ESM::RefId::stringRefId(rec["skill"].get<std::string_view>());
|
ESM::RefId skill = ESM::RefId::deserializeText(rec["skill"].get<std::string_view>());
|
||||||
|
|
||||||
book.mData.mSkillId = -1;
|
book.mData.mSkillId = -1;
|
||||||
if (!skill.empty())
|
if (!skill.empty())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user