1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-01 03:21:41 +00:00

Added lua enum for attacktypes

This commit is contained in:
Max Yari 2024-06-21 00:26:48 +02:00
parent 70c822d036
commit 7d659ae64c
2 changed files with 2 additions and 1 deletions

View File

@ -63,6 +63,8 @@ namespace MWLua
selfAPI["controls"] = sol::readonly_property([](SelfObject& self) { return &self.mControls; });
selfAPI["isActive"] = [](SelfObject& self) { return &self.mIsActive; };
selfAPI["enableAI"] = [](SelfObject& self, bool v) { self.mControls.mDisableAI = !v; };
selfAPI["attackType"] = LuaUtil::makeStrictReadOnly(context.mLua->tableFromPairs<std::string_view, int>(
{ { "NoAttack", 0 }, { "Chop", 1 }, { "Slash", 2 }, { "Thrust", 3 } }));
using AiPackage = MWMechanics::AiPackage;
sol::usertype<AiPackage> aiPackage = context.mLua->sol().new_usertype<AiPackage>("AiPackage");

View File

@ -45,7 +45,6 @@ namespace MWMechanics
, mSideMovementAngle(0)
, mLevel(0)
, mAttackingOrSpell(false)
, mAttackType("")
{
for (const ESM::Attribute& attribute : MWBase::Environment::get().getESMStore()->get<ESM::Attribute>())
{