From 08c8ed4dd1c3280af87884c937383f6ad05aacfb Mon Sep 17 00:00:00 2001 From: xiyoo0812 Date: Thu, 30 May 2024 14:45:14 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B1=9E=E6=80=A7=E7=B3=BB=E7=BB=9F=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E5=A4=8D=E5=90=88=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/business/component/attr_component.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/business/component/attr_component.lua b/server/business/component/attr_component.lua index 442a5f83..ccb7ebc8 100644 --- a/server/business/component/attr_component.lua +++ b/server/business/component/attr_component.lua @@ -43,15 +43,15 @@ function AttrComponent:__delegate() return this:set_attr(attr.id, value) end if attr.increase then - AttrComponent["add_" .. attr.nick] = function(this, value) + AttrComponent["add_" .. attr.nick] = function(this, value, ncheck) if value < 0 then - return this:cost_attr(attr.id, value) + return this:cost_attr(attr.id, -value, ncheck) end return this:add_attr(attr.id, value) end AttrComponent["cost_" .. attr.nick] = function(this, value, ncheck) if value < 0 then - return this:add_attr(attr.id, value) + return this:add_attr(attr.id, -value) end return this:cost_attr(attr.id, value, ncheck) end