mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-28 23:09:46 +00:00
use std:;array
This commit is contained in:
parent
c311caef9a
commit
76f872aaa2
4 changed files with 4 additions and 4 deletions
|
@ -72,7 +72,7 @@ namespace MWLua
|
||||||
});
|
});
|
||||||
|
|
||||||
classT["specialization"] = sol::readonly_property([](const ESM::Class& rec) -> std::string_view {
|
classT["specialization"] = sol::readonly_property([](const ESM::Class& rec) -> std::string_view {
|
||||||
return ESM::Class::indexToLuaId[rec.mData.mSpecialization];
|
return ESM::Class::indexToLuaId.at(rec.mData.mSpecialization + 10);
|
||||||
});
|
});
|
||||||
classT["isPlayable"]
|
classT["isPlayable"]
|
||||||
= sol::readonly_property([](const ESM::Class& rec) -> bool { return rec.mData.mIsPlayable; });
|
= sol::readonly_property([](const ESM::Class& rec) -> bool { return rec.mData.mIsPlayable; });
|
||||||
|
|
|
@ -447,7 +447,7 @@ namespace MWLua
|
||||||
skillT["description"]
|
skillT["description"]
|
||||||
= sol::readonly_property([](const ESM::Skill& rec) -> std::string_view { return rec.mDescription; });
|
= sol::readonly_property([](const ESM::Skill& rec) -> std::string_view { return rec.mDescription; });
|
||||||
skillT["specialization"] = sol::readonly_property([](const ESM::Skill& rec) -> std::string_view {
|
skillT["specialization"] = sol::readonly_property([](const ESM::Skill& rec) -> std::string_view {
|
||||||
return ESM::Class::indexToLuaId[rec.mData.mSpecialization];
|
return ESM::Class::indexToLuaId.at(rec.mData.mSpecialization);
|
||||||
});
|
});
|
||||||
skillT["icon"] = sol::readonly_property([vfs](const ESM::Skill& rec) -> std::string {
|
skillT["icon"] = sol::readonly_property([vfs](const ESM::Skill& rec) -> std::string {
|
||||||
return Misc::ResourceHelpers::correctIconPath(rec.mIcon, vfs);
|
return Misc::ResourceHelpers::correctIconPath(rec.mIcon, vfs);
|
||||||
|
|
|
@ -10,7 +10,7 @@ namespace ESM
|
||||||
{
|
{
|
||||||
const std::string_view Class::sGmstSpecializationIds[3]
|
const std::string_view Class::sGmstSpecializationIds[3]
|
||||||
= { "sSpecializationCombat", "sSpecializationMagic", "sSpecializationStealth" };
|
= { "sSpecializationCombat", "sSpecializationMagic", "sSpecializationStealth" };
|
||||||
const std::string_view Class::indexToLuaId[3] = { "combat", "magic", "stealth" };
|
const std::array<std::string_view, 3> Class::indexToLuaId = { "combat", "magic", "stealth" };
|
||||||
|
|
||||||
int32_t& Class::CLDTstruct::getSkill(int index, bool major)
|
int32_t& Class::CLDTstruct::getSkill(int index, bool major)
|
||||||
{
|
{
|
||||||
|
|
|
@ -31,7 +31,7 @@ namespace ESM
|
||||||
Stealth = 2
|
Stealth = 2
|
||||||
};
|
};
|
||||||
static const std::string_view sGmstSpecializationIds[3];
|
static const std::string_view sGmstSpecializationIds[3];
|
||||||
static const std::string_view indexToLuaId[3];
|
static const std::array<std::string_view, 3> indexToLuaId;
|
||||||
|
|
||||||
struct CLDTstruct
|
struct CLDTstruct
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue