아이템 관련 버그 수정

This commit is contained in:
Hide_D committed 2019-10-09 11:34:56 +09:00
1 parent cb1ac4541b
commit 68aeafaa0b
18 files changed
+35 -27

No files matched your search

+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);