actor.ActiveEffects and actor.ActiveSpells

This commit is contained in:
Mads Buvik Sandvei 2023-05-20 17:49:32 +02:00
parent 55b2ce4a09
commit 7ba43c9426
8 changed files with 289 additions and 48 deletions

View file

@ -1,4 +1,5 @@
#include "attr.hpp"
#include <components/misc/strings/algorithm.hpp>
using namespace ESM;
@ -56,3 +57,12 @@ const std::string Attribute::sAttributeIcons[Attribute::Length] = {
"icons\\k\\attribute_personality.dds",
"icons\\k\\attribute_luck.dds",
};
Attribute::AttributeID Attribute::stringToAttributeId(std::string_view attribute)
{
for (auto id : ESM::Attribute::sAttributeIds)
if (Misc::StringUtils::ciEqual(ESM::Attribute::sAttributeNames[id], attribute))
return id;
throw std::logic_error("No such attribute: " + std::string(attribute));
}