This commit is contained in:
@@ -237,7 +237,12 @@ class User
|
||||
*/
|
||||
public function setMoney(int $money): void
|
||||
{
|
||||
$this->money = $money;
|
||||
$this->money = $money < 0 ? 0 : $money;
|
||||
}
|
||||
|
||||
public function saveMoney()
|
||||
{
|
||||
self::$db->execute('update users set money = ? where id = ?', [$this->money, $this->id]);
|
||||
}
|
||||
|
||||
|
||||
@@ -338,7 +343,7 @@ class User
|
||||
|
||||
public function saveShadow()
|
||||
{
|
||||
self::$db->execute('UPDATE users SET shadow = ? WHERE id = ?', [$this->getShadow(), $this->getId()]);
|
||||
self::$db->execute('UPDATE users SET shadow = ? WHERE id = ?', [$this->shadow, $this->id]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user