Полный отказ от $u->testAction() целиком.
This commit is contained in:
@@ -4,6 +4,7 @@ if (!defined('GAME_VERSION')) {
|
||||
}
|
||||
|
||||
use Core\{Config, Database, Db};
|
||||
use Model\ActionModel;
|
||||
use User\ItemsModel;
|
||||
use User\UserIp;
|
||||
|
||||
@@ -43,9 +44,9 @@ if ($u->info['bithday'] == '01.01.1800' && $u->info['inTurnirnew'] == 0) {
|
||||
}
|
||||
|
||||
#--------для общаги, и позже для почты
|
||||
$sleep = $u->testAction('`vars` = "sleep" AND `uid` = "' . $u->info['id'] . '" LIMIT 1', 1);
|
||||
$sleep = ActionModel::getOne(["uid = {$u->info['id']}", 'vars = sleep'], 'id');
|
||||
if ($u->room['file'] != "room_hostel" && $u->room['file'] != "an/room_hostel" && !empty($sleep)) {
|
||||
Db::sql('update actions set vars = ? where id = ?', ['unsleep', $sleep['id']]);
|
||||
Db::sql('update actions set vars = ? where id = ?', ['unsleep', $sleep]);
|
||||
}
|
||||
if ($u->room['file'] == "room_hostel" || $u->room['file'] == "post") {
|
||||
$trololo = 0;
|
||||
@@ -255,7 +256,7 @@ if ($magic->youuse > 0) {
|
||||
if ($act != -2) {
|
||||
$u->stats = $u->getStats($u->info['id'], 0, 1);
|
||||
$u->aves = ItemsModel::inventoryWeightAndItemQuantity();
|
||||
if (!isset($sleep['id'])) {
|
||||
if (empty($sleep)) {
|
||||
$act2 = $u->testItems($u->info['id'], $u->stats, 0);
|
||||
}
|
||||
if ($act2 != -2 && $act == -2) {
|
||||
@@ -413,7 +414,7 @@ if (isset($btl_last['id']) && $u->info['battle'] == 0) {
|
||||
$u->info['battle_lsto'] = true;
|
||||
} elseif ($u->info['battle'] == 0) {
|
||||
//Проверка/Снятие предметов
|
||||
if (!isset($sleep['id'])) {
|
||||
if (empty($sleep)) {
|
||||
$act2 = $u->testItems($u->info['id'], $u->stats, 0);
|
||||
}
|
||||
if ($act2 != -2 && $act == -2) {
|
||||
|
||||
Reference in New Issue
Block a user