Перенос и унификация функции снятия предметов в класс DressedItems.

This commit is contained in:
lopar
2021-03-11 20:42:36 +02:00
parent 1d2128830f
commit ac3a6ab4d2
6 changed files with 21 additions and 278 deletions
+4 -2
View File
@@ -142,7 +142,8 @@ if (isset($_POST['exit'])) {
}
$dresed = mysql_query('SELECT `id`, `type` FROM `inventory` WHERE `dressed` = 1 AND `laba` = 2 AND `owner` = "' . $user['id'] . '"');
while ($pl = mysql_fetch_array($dresed)) {
dropitemid($pl['type'], $user['id']);
$item = new \Battles\DressedItems($user['id']);
$item->undressItem($pl['type']);
}
mysql_query('DELETE FROM `inventory` WHERE `laba` > 0 AND `owner` = "' . $user['id'] . '"');
mysql_query("UPDATE `users`, `online` SET `users`.`room` = '1051', `online`.`room` = '1051', `users`.`x` = '0', `users`.`y` = '0', `users`.`laba` = '0' WHERE `online`.`id` = `users`.`id` AND `online`.`id` = '" . $user['id'] . "'");
@@ -291,7 +292,8 @@ if ($user['y'] >= count($map_d) - 2) {
}
$dresed = mysql_query('SELECT `id`, `type` FROM `inventory` WHERE `dressed` = 1 AND `laba` = 2 AND `owner` = "' . $user['id'] . '"');
while ($pl = mysql_fetch_array($dresed)) {
dropitemid($pl['type'], $user['id']);
$item = new \Battles\DressedItems($user['id']);
$item->undressItem($pl['type']);
}
mysql_query('UPDATE `inventory` SET `laba` = 0 WHERE `laba` = 1 AND `owner` = "' . $user['id'] . '"');
mysql_query('DELETE FROM `inventory` WHERE `laba` = 2 AND `owner` = "' . $user['id'] . '"');