diff --git a/classes/User.php b/classes/User.php index 2800b5a..1953c90 100644 --- a/classes/User.php +++ b/classes/User.php @@ -43,8 +43,13 @@ class User } } - protected function showItem(array $item) { - echo sprintf('%s', $item['image'], $item['name']); + protected function showItem(array $item) + { + if ($item) { + echo sprintf('%s', $item['image'], $item['name']); + } else { + echo ""; + } } public function showUserInfo() { @@ -65,15 +70,19 @@ class User Находится в {$this->getRoomName($this->room)}
Предметы на тушке:
USERINFO; - if (isset($dressed_item[1])) { - $this->showItem($dressed_item[1]); - } - if (isset($dressed_item[2])) { - $this->showItem($dressed_item[2]); - } - if (isset($dressed_item[4])) { - $this->showItem($dressed_item[4]); - } + $this->showItem($dressed_item[1]); + $this->showItem($dressed_item[2]); + $this->showItem($dressed_item[3]); + $this->showItem($dressed_item[4]); +// if (isset($dressed_item[1])) { +// $this->showItem($dressed_item[1]); +// } +// if (isset($dressed_item[2])) { +// $this->showItem($dressed_item[2]); +// } +// if (isset($dressed_item[4])) { +// $this->showItem($dressed_item[4]); +// } } } \ No newline at end of file