fix: 천통 후에도 rank var 등이 갱신되는 것 처럼 보이는 문제 수정

This commit is contained in:
2021-08-11 01:02:54 +09:00
parent 81513a40e8
commit 564f0bc407
+7 -5
View File
@@ -58,7 +58,7 @@ class General implements iAction{
'snipe_combat'=>[true, 10, '병종 상성 우위 횟수'], 'snipe_combat'=>[true, 10, '병종 상성 우위 횟수'],
'combat'=>[['rank', 'warnum'], 5, '전투 횟수'], 'combat'=>[['rank', 'warnum'], 5, '전투 횟수'],
'sabotage'=>[['rank', 'firenum'], 20, '계략 성공 횟수'], 'sabotage'=>[['rank', 'firenum'], 20, '계략 성공 횟수'],
'unifier'=>[true, 1, '천통 수뇌'], 'unifier'=>[true, 1, '천통 기여'],
'dex'=>[false, 0.001, '숙련도'], 'dex'=>[false, 0.001, '숙련도'],
'tournament'=>[true, 1, '토너먼트'], 'tournament'=>[true, 1, '토너먼트'],
'betting'=>[false, 10, '베팅 당첨'], 'betting'=>[false, 10, '베팅 당첨'],
@@ -1167,7 +1167,7 @@ class General implements iAction{
/** /**
* @return int|float * @return int|float
*/ */
public function getInheritancePoint(string $key, &$aux=null){ public function getInheritancePoint(string $key, &$aux=null, bool $forceCalc=false){
$inheritType = static::INHERITANCE_KEY[$key]??null; $inheritType = static::INHERITANCE_KEY[$key]??null;
if($inheritType === null){ if($inheritType === null){
throw new \OutOfRangeException("{$key}는 유산 타입이 아님"); throw new \OutOfRangeException("{$key}는 유산 타입이 아님");
@@ -1184,7 +1184,8 @@ class General implements iAction{
[$storeType, $multiplier, ] = $inheritType; [$storeType, $multiplier, ] = $inheritType;
if($storeType === true){ $gameStor = KVStorage::getStorage(DB::db(), 'game_env');
if($storeType === true || ($gameStor->isunited != 0 && !$forceCalc)){
$inheritStor = KVStorage::getStorage(DB::db(), "inheritance_{$ownerID}"); $inheritStor = KVStorage::getStorage(DB::db(), "inheritance_{$ownerID}");
[$value, $aux] = $inheritStor->getValue($key); [$value, $aux] = $inheritStor->getValue($key);
return $value; return $value;
@@ -1329,11 +1330,12 @@ class General implements iAction{
$inheritStor = KVStorage::getStorage(DB::db(), "inheritance_{$ownerID}"); $inheritStor = KVStorage::getStorage(DB::db(), "inheritance_{$ownerID}");
$inheritStor->cacheAll(); $inheritStor->cacheAll();
foreach(static::INHERITANCE_KEY as $key=>[$storType, ,]){ foreach(static::INHERITANCE_KEY as $key=>[$storType, ,]){
$point = $this->getInheritancePoint($key); $aux = null;
$point = $this->getInheritancePoint($key, $aux, true);
if($storType === true){ if($storType === true){
continue; continue;
} }
$inheritStor->setValue($key, $point); $inheritStor->setValue($key, [$point, $aux]);
} }
$oldInheritStor = KVStorage::getStorage(DB::db(), "inheritance_result"); $oldInheritStor = KVStorage::getStorage(DB::db(), "inheritance_result");