mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Regenerate world site mapping on setup
This commit is contained in:
parent
57efd24573
commit
f911e6e5b6
@ -352,7 +352,7 @@ fn travel_to_point(wpos: Vec2<f32>) -> impl Action {
|
||||
let diff = wpos - start;
|
||||
let n = (diff.magnitude() / WAYPOINT).max(1.0);
|
||||
let mut points = (1..n as usize + 1).map(move |i| start + diff * (i as f32 / n));
|
||||
traverse_points(move |_| points.next()).boxed()
|
||||
traverse_points(move |_| points.next())
|
||||
})
|
||||
.debug(|| "travel to point")
|
||||
}
|
||||
|
@ -11,7 +11,7 @@ impl Rule for Setup {
|
||||
rtstate.bind::<Self, OnSetup>(|ctx| {
|
||||
let data = &mut *ctx.state.data_mut();
|
||||
// Delete rtsim sites that don't correspond to a world site
|
||||
data.sites.retain(|site_id, site| {
|
||||
data.sites.sites.retain(|site_id, site| {
|
||||
if let Some((world_site_id, _)) = ctx
|
||||
.index
|
||||
.sites
|
||||
@ -19,6 +19,7 @@ impl Rule for Setup {
|
||||
.find(|(_, world_site)| world_site.get_origin() == site.wpos)
|
||||
{
|
||||
site.world_site = Some(world_site_id);
|
||||
data.sites.world_site_map.insert(world_site_id, site_id);
|
||||
true
|
||||
} else {
|
||||
warn!(
|
||||
|
@ -146,7 +146,6 @@ impl Rule for SimulateNpcs {
|
||||
cell.vehicles.push(vehicle_id);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
for (npc_id, npc) in data.npcs.npcs.iter_mut() {
|
||||
// Update the NPC's current site, if any
|
||||
|
Loading…
Reference in New Issue
Block a user