Рефакторинг заявок на поединок.
This commit is contained in:
@@ -2599,7 +2599,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
|
||||
public function addNewbot($id, $botDate, $clon, $logins_bot = null, $luser = null, $round = null)
|
||||
{
|
||||
if ($clon != null) {
|
||||
$r = false;
|
||||
$r = 0;
|
||||
if (!is_array($clon)) {
|
||||
$clon = $this->getUserInfoById((int)$clon);
|
||||
}
|
||||
@@ -11887,4 +11887,22 @@ LIMIT 1'
|
||||
Db::sql('update users set online = unix_timestamp() where id = ?', [$uid]);
|
||||
}
|
||||
|
||||
public function isModerator(): bool
|
||||
{
|
||||
return $this->isAdmin() || $this->info['align'] > 3 && $this->info['align'] < 4;
|
||||
}
|
||||
|
||||
public function isAdmin(): bool
|
||||
{
|
||||
return $this->info['admin'] > 0;
|
||||
}
|
||||
|
||||
/** Игрок имеет меньше 30% хп.
|
||||
* @return bool
|
||||
*/
|
||||
public function isWeakened(): bool
|
||||
{
|
||||
return $this->stats['hpNow'] < ceil($this->stats['hpMax'] / 100 * 30);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user