From 64bf65f6bbf3c01ddc3cf67e45489544fc8f0c2a Mon Sep 17 00:00:00 2001 From: DarkGod <darkgod@net-core.org> Date: Fri, 24 Jul 2020 16:59:22 +0200 Subject: [PATCH] Fixed a few skills taht work on living things from working on Lich --- game/modules/tome/class/Actor.lua | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/game/modules/tome/class/Actor.lua b/game/modules/tome/class/Actor.lua index 75047f231e..083d768d56 100644 --- a/game/modules/tome/class/Actor.lua +++ b/game/modules/tome/class/Actor.lua @@ -6903,8 +6903,8 @@ end -- Classifications for actor resist/damage -- Thanks to grayswandir for this really neat code structure _M.classifications = { - unliving = {undead = true, construct = true, crystal = true}, - unnatural = {demon = true, elemental = true, horror = true, construct = true, undead = true}, + unliving = {attrs={undead = true}, types={undead = true, construct = true, crystal = true}}, + unnatural = {attrs={demon = true, undead = true}, types={demon = true, elemental = true, horror = true, construct = true, undead = true}}, living = function(self) return not self:checkClassification('unliving') end, natural = function(self) return not self:checkClassification('unnatural') end, summoned = function(self) return (self.summoner ~= nil) end @@ -6920,8 +6920,15 @@ function _M:checkClassification(type_str) if (tostring(self.type).."/"..tostring(self.subtype) == type_str) or self.type == type_str then return true end local class = _M.classifications[type_str] if not class then return false end - if type(class) == 'function' then return class(self) end - return class[self.type or "unknown"] + if type(class) == 'function' then + return class(self) + else + if class.types and class.types[self.type or "unknown"] then return true end + if class.attrs then + for a, _ in pairs(class.attrs) do if self:attr(a) then return true end end + end + end + return false end --- Gains some experience -- GitLab