diff --git a/webapp/controller/HeroController.class.php b/webapp/controller/HeroController.class.php index 8d09039d..194c114f 100644 --- a/webapp/controller/HeroController.class.php +++ b/webapp/controller/HeroController.class.php @@ -140,7 +140,7 @@ class HeroController extends BaseAuthedController { $heroUniId = getReqVal('hero_uniid', 0); $heroDb = Hero::find($heroUniId); if (!$heroDb) { - $this->_rspErr(1, 'hero does not exist'); + $this->_rspErr(1, 'hero does not exist1'); return; } $heroDto = Hero::toDto($heroDb); @@ -164,7 +164,7 @@ class HeroController extends BaseAuthedController { } } if (!$found) { - $this->_rspErr(1, 'hero does not exist'); + $this->_rspErr(1, 'hero does not exist2'); return; } $this->_setV(TN_HERO_LEVEL_UP, $idx, 0); diff --git a/webapp/mt/HeroLevelAttr.php b/webapp/mt/HeroLevelAttr.php index 384de985..38fc8f28 100644 --- a/webapp/mt/HeroLevelAttr.php +++ b/webapp/mt/HeroLevelAttr.php @@ -28,7 +28,9 @@ class HeroLevelAttr { )) { $val = self::getAttrValue($meta); if ($val > 0) { - array_push(array( + array_push( + $newAttrs, + array( 'attr_id' => $meta['attr_id'], 'type' => $meta['type'], 'val' => $val, @@ -37,7 +39,7 @@ class HeroLevelAttr { } } } - AttrHelper::addRandAttrs($dbAttrs, $newAttrs); + AttrHelper::mergeAttr($dbAttrs, $newAttrs); return true; } @@ -48,8 +50,8 @@ class HeroLevelAttr { $totalSpace = 0; foreach ($strs as $tmpStr) { $strs2 = explode(':', $tmpStr); - if (count($str2) == 2) { - $totalSpace += $str2[1]; + if (count($strs2) == 2) { + $totalSpace += $strs2[1]; } } @@ -58,11 +60,11 @@ class HeroLevelAttr { $currSpace = 0; foreach ($strs as $tmpStr) { $strs2 = explode(':', $tmpStr); - if (count($str2) == 2) { - $currSpace += $str2[1]; + if (count($strs2) == 2) { + $currSpace += $strs2[1]; } if ($randSpace <= $currSpace) { - return $str2[0]; + return $strs2[0]; } } }