diff --git a/classes/DressedItems.php b/classes/DressedItems.php index 892f0b1..98e5865 100644 --- a/classes/DressedItems.php +++ b/classes/DressedItems.php @@ -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 = <<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']; } diff --git a/classes/User.php b/classes/User.php index 171836f..1d07a01 100644 --- a/classes/User.php +++ b/classes/User.php @@ -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('
', $i); if (isset($di->$dressedItems[$i])) { @@ -395,4 +394,9 @@ class User { return $this->health; } + + public function setRoom() + { + + } } \ No newline at end of file diff --git a/main.php b/main.php index 7c83ca6..4ebac61 100644 --- a/main.php +++ b/main.php @@ -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']) { + //(масса: getItemsWeight() . '/' . $showUser->strength * 4 + + if ($d['sum_weight'] > $user['strength'] * 4 && $_GET['got']) { err('У вас переполнен рюкзак, вы не можете передвигаться...'); $imove = false; }