From 1780122936a77ba7fe5e396eb8ea6cc8c0752a27 Mon Sep 17 00:00:00 2001 From: Hide_D Date: Tue, 28 Mar 2023 09:54:24 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EB=AA=A8=EB=93=A0=20=EB=82=B4=ED=8A=B9/?= =?UTF-8?q?=EC=A0=84=ED=8A=B9=20=EC=82=AC=EC=9A=A9=EC=8B=9C=20=EC=97=90?= =?UTF-8?q?=EB=9F=AC=EB=82=98=EB=8A=94=20=EB=AC=B8=EC=A0=9C=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/sammo/SpecialityHelper.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/hwe/sammo/SpecialityHelper.php b/hwe/sammo/SpecialityHelper.php index 94105626..015df86a 100644 --- a/hwe/sammo/SpecialityHelper.php +++ b/hwe/sammo/SpecialityHelper.php @@ -198,6 +198,7 @@ class SpecialityHelper{ public static function pickSpecialDomestic(RandUtil $rng, array $general, array $prevSpecials=[]) : string{ $pAbs = []; $pRel = []; + $id = null; $myCond = static::calcCondGeneric($general); @@ -240,7 +241,10 @@ class SpecialityHelper{ } } - $id = $rng->choiceUsingWeight($pRel); + if($pRel){ + $id = $rng->choiceUsingWeight($pRel); + } + if($id){ return $id; } @@ -256,6 +260,7 @@ class SpecialityHelper{ $reqDex = []; $pAbs = []; $pRel = []; + $id = null; $myCond = static::calcCondGeneric($general); $myCond |= static::calcCondDexterity($rng, $general); @@ -307,7 +312,10 @@ class SpecialityHelper{ } } - $id = $rng->choiceUsingWeight($pRel); + if($pRel){ + $id = $rng->choiceUsingWeight($pRel); + } + if($id){ return $id; }