mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-06-28 00:24:23 +00:00
Fixed a bug while destroying a village
+If a village is destroyed, all oasis of it, will return to the Nature +If a village is destroyed all trade routes from and to it, will be deleted
This commit is contained in:
@@ -3012,8 +3012,6 @@ class Automation {
|
||||
$database->query($q);
|
||||
$q = "DELETE FROM ".TB_PREFIX."market where vref = $wref";
|
||||
$database->query($q);
|
||||
$q = "DELETE FROM ".TB_PREFIX."odata where wref = $wref";
|
||||
$database->query($q);
|
||||
$q = "DELETE FROM ".TB_PREFIX."research where vref = $wref";
|
||||
$database->query($q);
|
||||
$q = "DELETE FROM ".TB_PREFIX."tdata where vref = $wref";
|
||||
@@ -3028,9 +3026,12 @@ class Automation {
|
||||
$database->query($q);
|
||||
$q = "DELETE FROM ".TB_PREFIX."raidlist where towref = $wref";
|
||||
$database->query($q);
|
||||
$q = "DELETE FROM ".TB_PREFIX."route where wid = $wref OR `from` = $wref";
|
||||
$database->query($q);
|
||||
$q = "DELETE FROM ".TB_PREFIX."movement where proc = 0 AND ((`to` = $wref AND sort_type=4) OR (`from` = $wref AND sort_type=3))";
|
||||
$database->query($q);
|
||||
|
||||
$database->removeOasesByVid($wref);
|
||||
|
||||
$getmovement = $database->getMovement(3,$wref,1);
|
||||
|
||||
$moveIDs = [];
|
||||
|
||||
+15
-2
@@ -1568,6 +1568,20 @@ class MYSQLi_DB implements IDbConnection {
|
||||
$q = "UPDATE ".TB_PREFIX."odata SET conqured = 0, owner = 2, name = 'Unoccupied Oasis' WHERE wref = ".$wref;
|
||||
return mysqli_query($this->dblink,$q);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove all oasis of a specified village
|
||||
*
|
||||
* @param int $vid The village ID of the oasis owner
|
||||
* @return bool Returns true if the query was successful, false otherwise
|
||||
*/
|
||||
|
||||
function removeOasesByVid($vid) {
|
||||
list($vid) = $this->escape_input((int) $vid);
|
||||
|
||||
$q = "UPDATE ".TB_PREFIX."odata SET conqured = 0, owner = 2, name = 'Unoccupied Oasis' WHERE conqured = ".$vid;
|
||||
return mysqli_query($this->dblink, $q);
|
||||
}
|
||||
|
||||
|
||||
/***************************
|
||||
@@ -6886,8 +6900,7 @@ References: User ID/Message ID, Mode
|
||||
$chiefslots = 0;
|
||||
}
|
||||
|
||||
$slots = array("chiefs" => $chiefslots, "settlers" => $settlerslots);
|
||||
return $slots;
|
||||
return ["chiefs" => $chiefslots, "settlers" => $settlerslots];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user