diff --git a/GameEngine/Automation.php b/GameEngine/Automation.php index 29c0a9d0..2380cf3e 100755 --- a/GameEngine/Automation.php +++ b/GameEngine/Automation.php @@ -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 = []; diff --git a/GameEngine/Database.php b/GameEngine/Database.php index 4a0df821..d026d71c 100755 --- a/GameEngine/Database.php +++ b/GameEngine/Database.php @@ -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]; } /**