Merge branch 'devel' into g38_ui
This commit is contained in:
@@ -1155,7 +1155,7 @@ function setGift($tnmt_type, $tnmt, $phase)
|
||||
foreach (General::createGeneralObjListFromDB(Util::squeezeFromArray($gambleResult, 'general_id'), ['gold', 'npc'], 1) as $gambler) {
|
||||
$reward = Util::round($gambleResult[$gambler->getID()]['bet'] * $rewardRate);
|
||||
$gambler->increaseVar('gold', $reward);
|
||||
if (($gambler->getNPCType() == 0) || ($gambler->getNPCType() == 1 && $gambler->getRankVar('betgold') > 0)) {
|
||||
if (($gambler->getNPCType() == 0) || ($gambler->getNPCType() == 1 && $gambler->getRankVar('betgold', 0) > 0)) {
|
||||
$gambler->increaseRankVar('betwingold', $reward);
|
||||
$gambler->increaseRankVar('betwin', 1);
|
||||
}
|
||||
|
||||
@@ -781,7 +781,7 @@ class General implements iAction
|
||||
$this->rankVarSet[$key] = $value;
|
||||
}
|
||||
|
||||
function getRankVar(string $key): int
|
||||
function getRankVar(string $key, $defaultValue = null): int
|
||||
{
|
||||
if (!key_exists($key, static::RANK_COLUMN)) {
|
||||
throw new \InvalidArgumentException('올바르지 않은 인자 :' . $key);
|
||||
@@ -792,7 +792,10 @@ class General implements iAction
|
||||
}
|
||||
|
||||
if (!key_exists($key, $this->rankVarRead)) {
|
||||
throw new \RuntimeException('인자가 없음 : ' . $key);
|
||||
if($defaultValue === null){
|
||||
throw new \RuntimeException('인자가 없음 : ' . $key);
|
||||
}
|
||||
return $defaultValue;
|
||||
}
|
||||
|
||||
return $this->rankVarRead[$key];
|
||||
|
||||
Reference in New Issue
Block a user