|
|
@ -12,14 +12,7 @@ use crate::world::Zone;
|
|
|
|
impl Db {
|
|
|
|
impl Db {
|
|
|
|
/// Get root zone
|
|
|
|
/// Get root zone
|
|
|
|
pub fn root_zone(&self, zone: &Zone) -> RudeResult<Zone> {
|
|
|
|
pub fn root_zone(&self, zone: &Zone) -> RudeResult<Zone> {
|
|
|
|
// get rid of the &
|
|
|
|
let mut zone: Zone = zone.into();
|
|
|
|
let mut zone = Zone {
|
|
|
|
|
|
|
|
id: zone.id,
|
|
|
|
|
|
|
|
parent: zone.parent,
|
|
|
|
|
|
|
|
name: zone.name.clone(),
|
|
|
|
|
|
|
|
users_visible: zone.users_visible,
|
|
|
|
|
|
|
|
areas: zone.areas.clone(),
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// loop until find the root
|
|
|
|
// loop until find the root
|
|
|
|
loop {
|
|
|
|
loop {
|
|
|
|