From eeb5eabd1246c13089d4ba62de41d289f10bbeb0 Mon Sep 17 00:00:00 2001 From: Hide_D Date: Tue, 1 Aug 2023 16:16:31 +0000 Subject: [PATCH] =?UTF-8?q?feat:=20increaseInheritancePoint=EC=97=90=20?= =?UTF-8?q?=EB=8D=94=ED=95=B4=EC=A7=84=20=ED=9B=84=EC=9D=98=20=EA=B0=92=20?= =?UTF-8?q?=EB=B0=98=ED=99=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/sammo/InheritancePointManager.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/hwe/sammo/InheritancePointManager.php b/hwe/sammo/InheritancePointManager.php index 047a055e..ae607892 100644 --- a/hwe/sammo/InheritancePointManager.php +++ b/hwe/sammo/InheritancePointManager.php @@ -220,7 +220,7 @@ class InheritancePointManager $inheritStor->setValue($key, [$value, $aux]); } - public function increaseInheritancePointRaw(int $ownerID, InheritanceKey $key, $value, $aux = null) + public function increaseInheritancePointRaw(int $ownerID, InheritanceKey $key, $value, $aux = null): int|float|null { if (!is_int($value) && !is_float($value)) { throw new \InvalidArgumentException("{$value}는 숫자가 아님"); @@ -236,7 +236,7 @@ class InheritancePointManager $gameStor = KVStorage::getStorage(DB::db(), 'game_env'); if ($gameStor->isunited != 0) { - return; + return null; } $inheritStor = KVStorage::getStorage(DB::db(), "inheritance_{$ownerID}"); @@ -248,6 +248,7 @@ class InheritancePointManager $newValue = $oldValue + $value * $multiplier; $inheritStor->setValue($key->value, [$newValue, $aux]); + return $newValue; } public function increaseInheritancePoint(General $general, InheritanceKey $key, $value, $aux = null) @@ -262,7 +263,7 @@ class InheritancePointManager return; } - $this->increaseInheritancePointRaw($ownerID, $key, $value, $aux); + return $this->increaseInheritancePointRaw($ownerID, $key, $value, $aux); } public function clearInheritancePoint(?int $ownerID) @@ -359,7 +360,7 @@ class InheritancePointManager $userLogger = new UserLogger($ownerID); - $previousPoint = ($allPoints[InheritanceKey::previous->value] ?? [0, 0])[0]; + $previousPoint = ($allPoints[InheritanceKey::previous->value] ?? [0, null])[0]; $keepValues = [];