From 41273f97dbff281806f598a81e239335550ae706 Mon Sep 17 00:00:00 2001 From: Hide_D Date: Tue, 1 Aug 2023 16:13:46 +0000 Subject: [PATCH] =?UTF-8?q?feat,refac:=20increaseInheritancePointRaw=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80=20-=20ownerID=EB=A7=8C=EC=9C=BC=EB=A1=9C=20?= =?UTF-8?q?=EC=B2=98=EB=A6=AC=20=EA=B0=80=EB=8A=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/sammo/InheritancePointManager.php | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/hwe/sammo/InheritancePointManager.php b/hwe/sammo/InheritancePointManager.php index 5c975070..047a055e 100644 --- a/hwe/sammo/InheritancePointManager.php +++ b/hwe/sammo/InheritancePointManager.php @@ -220,7 +220,7 @@ class InheritancePointManager $inheritStor->setValue($key, [$value, $aux]); } - public function increaseInheritancePoint(General $general, InheritanceKey $key, $value, $aux = null) + public function increaseInheritancePointRaw(int $ownerID, InheritanceKey $key, $value, $aux = null) { if (!is_int($value) && !is_float($value)) { throw new \InvalidArgumentException("{$value}는 숫자가 아님"); @@ -234,15 +234,6 @@ class InheritancePointManager throw new \InvalidArgumentException("{$key->value}는 직접 저장형 유산 포인트가 아님"); } - $ownerID = $general->getVar('owner'); - if (!$ownerID) { - return; - } - - if ($general->getVar('npc') >= 2) { - return; - } - $gameStor = KVStorage::getStorage(DB::db(), 'game_env'); if ($gameStor->isunited != 0) { return; @@ -259,6 +250,21 @@ class InheritancePointManager $inheritStor->setValue($key->value, [$newValue, $aux]); } + public function increaseInheritancePoint(General $general, InheritanceKey $key, $value, $aux = null) + { + + $ownerID = $general->getVar('owner'); + if (!$ownerID) { + return; + } + + if ($general->getVar('npc') >= 2) { + return; + } + + $this->increaseInheritancePointRaw($ownerID, $key, $value, $aux); + } + public function clearInheritancePoint(?int $ownerID) { if (!$ownerID) {