diff --git a/hwe/func.php b/hwe/func.php index 050ab21e..bde7ffc5 100644 --- a/hwe/func.php +++ b/hwe/func.php @@ -1758,12 +1758,11 @@ function tryInheritUniqueItem(General $general, string $acquireType = '아이템 $reasons[] = '이미 그 유니크를 가지고 있습니다.'; continue; } - /* + if (!$ownItem->isBuyable()) { $reasons[] = '이미 다른 유니크를 가지고 있습니다.'; continue; } - */ $availableCnt = $itemList[$itemKey]; $occupiedCnt = $db->queryFirstField('SELECT count(*) FROM general WHERE %b = %s', $itemType, $itemKey); @@ -1865,6 +1864,9 @@ function tryInheritUniqueItem(General $general, string $acquireType = '아이템 $general->applyDB($db); + //같은 종류의 유니크를 입찰했을 수 있으니 한번 더 검사한다. + tryRollbackInheritUniqueItem($general); + return true; } diff --git a/hwe/sammo/API/InheritAction/BuySpecificUnique.php b/hwe/sammo/API/InheritAction/BuySpecificUnique.php index d97da7c5..33f1c28e 100644 --- a/hwe/sammo/API/InheritAction/BuySpecificUnique.php +++ b/hwe/sammo/API/InheritAction/BuySpecificUnique.php @@ -67,6 +67,19 @@ class BuySpecificUnique extends \sammo\BaseAPI return '이미 입찰한 아이템입니다. 다음 턴에 시도해 주세요.'; } + foreach(GameConst::$allItems as $itemType => $items){ + if(!key_exists($itemKey, $items)){ + continue; + } + + $prevItem = $general->getItem($itemType); + if(!$prevItem->isBuyable()){ + return '이미 같은 자리에 유니크를 보유하고 있습니다.'; + } + + break; + } + $db = DB::db(); $inheritStor = KVStorage::getStorage($db, "inheritance_{$userID}"); $trialStor = KVStorage::getStorage($db, "ut_{$itemKey}");