mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-07-05 20:34:21 +00:00
fix: only 1 hero can exist and is deleted upon new hero training start
Closes #261
This commit is contained in:
@@ -3709,15 +3709,15 @@ class MYSQLi_DB implements IDbConnection {
|
||||
return $totalunits;
|
||||
}
|
||||
|
||||
function getHero($uid=0,$all=0) {
|
||||
function getHero($uid=0, $all=0, $include_dead = false) {
|
||||
list($uid,$all) = $this->escape_input((int) $uid,$all);
|
||||
|
||||
if ($all) {
|
||||
$q = "SELECT * FROM ".TB_PREFIX."hero WHERE uid=$uid";
|
||||
$q = "SELECT * FROM ".TB_PREFIX."hero WHERE uid=$uid ORDER BY lastupdate DESC";
|
||||
} elseif (!$uid) {
|
||||
$q = "SELECT * FROM ".TB_PREFIX."hero";
|
||||
} else {
|
||||
$q = "SELECT * FROM ".TB_PREFIX."hero WHERE dead=0 AND uid=$uid LIMIT 1";
|
||||
$q = "SELECT * FROM ".TB_PREFIX."hero WHERE ".($include_dead ? '' : "dead=0 AND ")."uid=$uid LIMIT 1";
|
||||
}
|
||||
$result = mysqli_query($this->dblink,$q);
|
||||
if (!empty($result)) {
|
||||
|
||||
Reference in New Issue
Block a user