предметы не отображались

This commit is contained in:
Igor Barkov (iwork) 2020-07-21 14:52:39 +03:00
parent 60aefbabe3
commit 7c88468cf1
3 changed files with 15 additions and 7 deletions

View File

@ -7,9 +7,9 @@
class DressedItems
{
protected static $DB;
protected static $DBSUM;
protected static $USERID;
private static $DB;
private static $DBSUM;
private static $USERID;
private $dressedItem;
/**
@ -32,7 +32,7 @@ class DressedItems
}
}
protected function getBonusesFromDressedItems()
private function getBonusesFromDressedItems()
{
try {
$query = <<<SQL
@ -66,6 +66,7 @@ SQL;
$dressed_item[$row['dressed_slot']] = $row;
$this->dressedItem[$row['dressed_slot']] = $row;
}
return $this->dressedItem ?? null;
}
protected function getBonuses()
@ -78,6 +79,7 @@ SQL;
public function getStrengthBonus()
{
//return $this->getBonuses()['sum_strength'];
return self::getBonuses()['sum_strength'];
}

View File

@ -75,7 +75,6 @@ class User
//https://jsfiddle.net/ngx0yvhc
$di = new DressedItems($this->id);
$dressedItems = $di->getItemsInSlots();
for ($i = 1; $i <= 12; $i++) {
echo sprintf('<div class="slot-%s">', $i);
if (isset($di->$dressedItems[$i])) {
@ -395,4 +394,9 @@ class User
{
return $this->health;
}
public function setRoom()
{
}
}

View File

@ -397,9 +397,11 @@ function dressitem($id)
// Входим и выходим если можем.
if (isset($_GET['goto'])) {
$imove = true;
$d = db::c()->query('SELECT SUM(`massa`) AS `summ` FROM `inventory` WHERE `owner` = ?i AND `dressed` = 0 AND `setsale` = 0', $user['id'])->fetch_assoc();
$d = db::c()->query('SELECT SUM(`weight`) AS `sum_weight` FROM `inventory` WHERE `owner` = ?i AND `on_sale` = 0', $user['id'])->fetch_assoc();
$eff = db::c()->query('SELECT 1 FROM `users_effects` WHERE `owner_id` = ?i AND (`type` = 14 OR `type` = 13)', $user['id']);
if ($d['summ'] > get_meshok() && $_GET['got']) {
//(масса: <?= $getItemsBonuses->getItemsWeight() . '/' . $showUser->strength * 4
if ($d['sum_weight'] > $user['strength'] * 4 && $_GET['got']) {
err('У вас переполнен рюкзак, вы не можете передвигаться...');
$imove = false;
}