mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-07-10 22:56:07 +00:00
Fixed some bugs and errors
+Part 1 of the starvation refactor, attacking troops will now be killed +Fixed some errors in Units.php, Technology.php, Battle.php and some 16_incomming.tpl -Removed an unused function in Database.php +Fixed a bug that could have destroyed a village after taking an artefact even if it had more than 0 pop
This commit is contained in:
+1
-17
@@ -1869,22 +1869,6 @@ class MYSQLi_DB implements IDbConnection {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Used to get the population of the whole account
|
||||
*
|
||||
* @param int $uid the user id
|
||||
* @return int Returns the total population of the account
|
||||
*/
|
||||
|
||||
function getTotalPopulation($uid){
|
||||
list($uid) = $this->escape_input((int) $uid);
|
||||
|
||||
$q = "SELECT Sum(pop) FROM " . TB_PREFIX . "vdata WHERE owner = ".$uid."";
|
||||
$result = mysqli_query($this->dblink, $q);
|
||||
$row = mysqli_fetch_row($result);
|
||||
return $row[0];
|
||||
}
|
||||
|
||||
function getVillageByWorldID($vid, $use_cache = true) {
|
||||
$array_passed = is_array($vid);
|
||||
@@ -7788,7 +7772,7 @@ References:
|
||||
function KillMyHero($id) {
|
||||
list( $id ) = $this->escape_input( (int) $id );
|
||||
|
||||
$q = "UPDATE " . TB_PREFIX . "hero set dead = 1, intraining = 0, inrevive = 0 where uid = " . $id . " AND dead = 0";
|
||||
$q = "UPDATE " . TB_PREFIX . "hero set dead = 1, intraining = 0, inrevive = 0, health = 0 where uid = " . $id . " AND dead = 0";
|
||||
|
||||
return mysqli_query( $this->dblink, $q );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user