diff --git a/apps/openmw/mwlua/types/npc.cpp b/apps/openmw/mwlua/types/npc.cpp index c0ffce9402..49acfb111b 100644 --- a/apps/openmw/mwlua/types/npc.cpp +++ b/apps/openmw/mwlua/types/npc.cpp @@ -80,10 +80,10 @@ namespace npc.mFlags &= ~ESM::NPC::Essential; } - if (rec["autocalc"] != sol::nil) + if (rec["isAutocalc"] != sol::nil) { - bool respawn = rec["autocalc"]; - if (respawn) + bool autoCalc = rec["isAutocalc"]; + if (autoCalc) npc.mFlags |= ESM::NPC::Autocalc; else npc.mFlags &= ~ESM::NPC::Autocalc; @@ -207,7 +207,7 @@ namespace MWLua addModelProperty(record); record["isEssential"] = sol::readonly_property([](const ESM::NPC& rec) -> bool { return rec.mFlags & ESM::NPC::Essential; }); - record["autocalc"] + record["isAutocalc"] = sol::readonly_property([](const ESM::NPC& rec) -> bool { return rec.mFlags & ESM::NPC::Autocalc; }); record["isMale"] = sol::readonly_property([](const ESM::NPC& rec) -> bool { return rec.isMale(); }); record["isRespawning"] diff --git a/apps/openmw/mwlua/types/servicesoffered.hpp b/apps/openmw/mwlua/types/servicesoffered.hpp index acf928dc7c..bfc4f96fc9 100644 --- a/apps/openmw/mwlua/types/servicesoffered.hpp +++ b/apps/openmw/mwlua/types/servicesoffered.hpp @@ -1,6 +1,5 @@ -#pragma once #include -#include // for ESM::NPC constants +#include #include inline constexpr std::array, 19> ServiceNames diff --git a/files/lua_api/openmw/types.lua b/files/lua_api/openmw/types.lua index 5f78467bdc..aa5b70c4e0 100644 --- a/files/lua_api/openmw/types.lua +++ b/files/lua_api/openmw/types.lua @@ -861,7 +861,7 @@ -- @field #boolean canWalk whether the creature can walk -- @field #boolean canUseWeapons whether the creature can use weapons and shields -- @field #boolean isBiped whether the creature is a biped --- @field #boolean autocalc If true, the actors stats will be automatically calculated based on level and class. +-- @field #boolean isAutocalc If true, the actors stats will be automatically calculated based on level and class. -- @field #string primaryFaction Faction ID of the NPCs default faction. Nil if no faction -- @field #number primaryFactionRank Faction rank of the NPCs default faction. Nil if no faction -- @field #boolean isEssential whether the creature is essential