refactor
This commit is contained in:
@@ -1021,8 +1021,7 @@ class Dialog
|
||||
}
|
||||
|
||||
$this->title = $this->info['text'];
|
||||
$this->youInfo = $u->getInfoPers($u->info['id'], 1);
|
||||
$this->youInfo = $this->youInfo[0];
|
||||
$this->youInfo = $u->getInfoPers($u->info['id'], 1)[0];
|
||||
$this->botInfo = $this->infoBot($this->info['bot_id']);
|
||||
//Диалог
|
||||
$qpl = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_dlg` WHERE `type` = "1" AND `qid` = "0" AND `id_dg` = "' . $this->info['id'] . '" AND `page` = "' . ((int)$pg) . '" LIMIT 1'));
|
||||
|
||||
@@ -84,21 +84,22 @@ class FightRequest
|
||||
);
|
||||
foreach ($sp as $pl) {
|
||||
$uz = Db::getRow(
|
||||
'select users.id, * from users left join stats on users.id = stats.id where zv = ?',
|
||||
'select * from users left join stats on users.id = stats.id where zv = ?',
|
||||
[$pl['id']]
|
||||
);
|
||||
$i = [];
|
||||
$toChat = '';
|
||||
$toWhere = '';
|
||||
foreach ($uz as $t) {
|
||||
${'tm' . $t['team']} ??= [];
|
||||
$i[$t['team']] ??= 0;
|
||||
${'tm' . $t['team']}[$i[$t['team']]] = $t;
|
||||
$toChat .= '' . $t['login'] . ',';
|
||||
$toWhere .= 'OR `id` = "' . $t['id'] . '" ';
|
||||
$i[$t['team']]++;
|
||||
if (is_iterable($uz)) {
|
||||
foreach ($uz as $t) {
|
||||
${'tm' . $t['team']} ??= [];
|
||||
$i[$t['team']] ??= 0;
|
||||
${'tm' . $t['team']}[$i[$t['team']]] = $t;
|
||||
$toChat .= '' . $t['login'] . ',';
|
||||
$toWhere .= 'OR `id` = "' . $t['id'] . '" ';
|
||||
$i[$t['team']]++;
|
||||
}
|
||||
}
|
||||
|
||||
if ($pl['razdel'] == self::BATTLE_RAZDEL_CHAOTIC) {
|
||||
$cols = $this->countUsersAll($pl['id']);
|
||||
if ($cols >= $pl['maxplayers']) {
|
||||
|
||||
@@ -1643,9 +1643,7 @@ class User
|
||||
);
|
||||
if (isset($t['id'])) {
|
||||
if ($this->info['login'] == $t['login']) {
|
||||
$this->error = 'Вы не можете передать самому себе, персонаж ' . $this->microLogin(
|
||||
$t['id'], 1
|
||||
) . '';
|
||||
$this->error = 'Вы не можете передать самому себе';
|
||||
} elseif ($t['battle'] > 0) {
|
||||
$this->error = 'Персонаж находится в бою';
|
||||
} elseif ($t['align'] == 2 && $this->info['admin'] == 0) {
|
||||
|
||||
Reference in New Issue
Block a user