아이템 관련 버그 수정

This commit is contained in:
2019-10-09 11:34:56 +09:00
parent 48cac053fd
commit bc5574615d
18 changed files with 35 additions and 27 deletions
+4 -3
View File
@@ -21,10 +21,11 @@ class BaseStatItem extends BaseItem{
public function __construct(){
$nameTokens = explode('_', static::class);
$this->statValue = (int)$nameTokens[-1];
$tokenLen = count($nameTokens);
$this->statValue = (int)$nameTokens[$tokenLen-2];
assert(is_numeric($this->statValue));
$this->rawName = $nameTokens[-2];
[$this->statNick, $this->statType] = static::ITEM_TYPE[$nameTokens[-3]];
$this->rawName = $nameTokens[$tokenLen-1];
[$this->statNick, $this->statType] = static::ITEM_TYPE[$nameTokens[$tokenLen-3]];
$this->id = $this->statValue;
$this->name = sprintf('%s(+%d)',$this->rawName, $this->statValue);