mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Removed per-level dungeon waypoints
This commit is contained in:
parent
e09c22f9cc
commit
28b0a00b44
@ -25,11 +25,10 @@ use common::{
|
|||||||
},
|
},
|
||||||
event::{EventBus, LocalEvent},
|
event::{EventBus, LocalEvent},
|
||||||
msg::{
|
msg::{
|
||||||
validate_chat_msg, ChatMsgValidationError, ClientGeneral, ClientMsg, ClientRegister,
|
validate_chat_msg, world_msg::SiteInfo, ChatMsgValidationError, ClientGeneral, ClientMsg,
|
||||||
ClientType, DisconnectReason, InviteAnswer, Notification, PingMsg, PlayerInfo,
|
ClientRegister, ClientType, DisconnectReason, InviteAnswer, Notification, PingMsg,
|
||||||
PlayerListUpdate, PresenceKind, RegisterError, ServerGeneral, ServerInfo, ServerInit,
|
PlayerInfo, PlayerListUpdate, PresenceKind, RegisterError, ServerGeneral, ServerInfo,
|
||||||
ServerRegisterAnswer, MAX_BYTES_CHAT_MSG,
|
ServerInit, ServerRegisterAnswer, MAX_BYTES_CHAT_MSG,
|
||||||
world_msg::SiteInfo,
|
|
||||||
},
|
},
|
||||||
outcome::Outcome,
|
outcome::Outcome,
|
||||||
recipe::RecipeBook,
|
recipe::RecipeBook,
|
||||||
@ -646,9 +645,7 @@ impl Client {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Unstable, likely to be removed in a future release
|
/// Unstable, likely to be removed in a future release
|
||||||
pub fn sites(&self) -> &[SiteInfo] {
|
pub fn sites(&self) -> &[SiteInfo] { &self.sites }
|
||||||
&self.sites
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn enable_lantern(&mut self) {
|
pub fn enable_lantern(&mut self) {
|
||||||
self.send_msg(ClientGeneral::ControlEvent(ControlEvent::EnableLantern));
|
self.send_msg(ClientGeneral::ControlEvent(ControlEvent::EnableLantern));
|
||||||
|
@ -42,9 +42,9 @@ use crate::{
|
|||||||
data_dir::DataDir,
|
data_dir::DataDir,
|
||||||
login_provider::LoginProvider,
|
login_provider::LoginProvider,
|
||||||
presence::{Presence, RegionSubscription},
|
presence::{Presence, RegionSubscription},
|
||||||
|
rtsim::RtSim,
|
||||||
state_ext::StateExt,
|
state_ext::StateExt,
|
||||||
sys::sentinel::{DeletedEntities, TrackedComps},
|
sys::sentinel::{DeletedEntities, TrackedComps},
|
||||||
rtsim::RtSim,
|
|
||||||
};
|
};
|
||||||
use common::{
|
use common::{
|
||||||
assets::Asset,
|
assets::Asset,
|
||||||
@ -52,16 +52,17 @@ use common::{
|
|||||||
comp::{self, ChatType},
|
comp::{self, ChatType},
|
||||||
event::{EventBus, ServerEvent},
|
event::{EventBus, ServerEvent},
|
||||||
msg::{
|
msg::{
|
||||||
ClientType, DisconnectReason, ServerGeneral, ServerInfo, ServerInit, ServerMsg, WorldMapMsg,
|
|
||||||
world_msg::{SiteInfo, SiteKind},
|
world_msg::{SiteInfo, SiteKind},
|
||||||
|
ClientType, DisconnectReason, ServerGeneral, ServerInfo, ServerInit, ServerMsg,
|
||||||
|
WorldMapMsg,
|
||||||
},
|
},
|
||||||
outcome::Outcome,
|
outcome::Outcome,
|
||||||
recipe::default_recipe_book,
|
recipe::default_recipe_book,
|
||||||
|
rtsim::RtSimEntity,
|
||||||
state::{State, TimeOfDay},
|
state::{State, TimeOfDay},
|
||||||
sync::WorldSyncExt,
|
sync::WorldSyncExt,
|
||||||
terrain::TerrainChunkSize,
|
terrain::TerrainChunkSize,
|
||||||
vol::{ReadVol, RectVolSize},
|
vol::{ReadVol, RectVolSize},
|
||||||
rtsim::RtSimEntity,
|
|
||||||
};
|
};
|
||||||
use futures_executor::block_on;
|
use futures_executor::block_on;
|
||||||
use metrics::{PhysicsMetrics, ServerMetrics, StateTickMetrics, TickMetrics};
|
use metrics::{PhysicsMetrics, ServerMetrics, StateTickMetrics, TickMetrics};
|
||||||
@ -559,8 +560,17 @@ impl Server {
|
|||||||
|
|
||||||
for entity in to_delete {
|
for entity in to_delete {
|
||||||
// Assimilate entities that are part of the real-time world simulation
|
// Assimilate entities that are part of the real-time world simulation
|
||||||
if let Some(rtsim_entity) = self.state.ecs().read_storage::<RtSimEntity>().get(entity).copied() {
|
if let Some(rtsim_entity) = self
|
||||||
self.state.ecs().write_resource::<RtSim>().assimilate_entity(rtsim_entity.0);
|
.state
|
||||||
|
.ecs()
|
||||||
|
.read_storage::<RtSimEntity>()
|
||||||
|
.get(entity)
|
||||||
|
.copied()
|
||||||
|
{
|
||||||
|
self.state
|
||||||
|
.ecs()
|
||||||
|
.write_resource::<RtSim>()
|
||||||
|
.assimilate_entity(rtsim_entity.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Err(e) = self.state.delete_entity_recorded(entity) {
|
if let Err(e) = self.state.delete_entity_recorded(entity) {
|
||||||
|
@ -109,6 +109,15 @@ impl<'a> System<'a> for Sys {
|
|||||||
|
|
||||||
// Handle chunk supplement
|
// Handle chunk supplement
|
||||||
for entity in supplement.entities {
|
for entity in supplement.entities {
|
||||||
|
// Check this because it's a common source of weird bugs
|
||||||
|
assert!(
|
||||||
|
terrain
|
||||||
|
.pos_key(entity.pos.map(|e| e.floor() as i32))
|
||||||
|
.map2(key, |e, tgt| (e - tgt).abs() <= 1)
|
||||||
|
.reduce_and(),
|
||||||
|
"Chunk spawned entity that wasn't nearby",
|
||||||
|
);
|
||||||
|
|
||||||
if entity.is_waypoint {
|
if entity.is_waypoint {
|
||||||
server_emitter.emit(ServerEvent::CreateWaypoint(entity.pos));
|
server_emitter.emit(ServerEvent::CreateWaypoint(entity.pos));
|
||||||
continue;
|
continue;
|
||||||
|
@ -20,11 +20,11 @@ mod column;
|
|||||||
pub mod config;
|
pub mod config;
|
||||||
pub mod index;
|
pub mod index;
|
||||||
pub mod layer;
|
pub mod layer;
|
||||||
|
pub mod pathfinding;
|
||||||
pub mod sim;
|
pub mod sim;
|
||||||
pub mod sim2;
|
pub mod sim2;
|
||||||
pub mod site;
|
pub mod site;
|
||||||
pub mod util;
|
pub mod util;
|
||||||
pub mod pathfinding;
|
|
||||||
|
|
||||||
// Reexports
|
// Reexports
|
||||||
pub use crate::{
|
pub use crate::{
|
||||||
|
@ -175,6 +175,17 @@ impl Dungeon {
|
|||||||
max: rpos + TerrainChunkSize::RECT_SIZE.map(|e| e as i32),
|
max: rpos + TerrainChunkSize::RECT_SIZE.map(|e| e as i32),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Add waypoint
|
||||||
|
let pos = self.origin.map2(FLOOR_SIZE, |e, sz| e + sz as i32 / 2);
|
||||||
|
if area.contains_point(pos - self.origin) {
|
||||||
|
supplement.add_entity(EntityInfo::at(Vec3::new(
|
||||||
|
pos.x as f32,
|
||||||
|
pos.y as f32,
|
||||||
|
self.alt as f32,
|
||||||
|
) + 0.5)
|
||||||
|
.into_waypoint());
|
||||||
|
}
|
||||||
|
|
||||||
let mut z = self.alt + ALT_OFFSET;
|
let mut z = self.alt + ALT_OFFSET;
|
||||||
for floor in &self.floors {
|
for floor in &self.floors {
|
||||||
z -= floor.total_depth();
|
z -= floor.total_depth();
|
||||||
@ -452,12 +463,12 @@ impl Floor {
|
|||||||
.try_normalized()
|
.try_normalized()
|
||||||
.unwrap_or_else(Vec2::unit_y)
|
.unwrap_or_else(Vec2::unit_y)
|
||||||
* (TILE_SIZE as f32 / 2.0 - 4.0);
|
* (TILE_SIZE as f32 / 2.0 - 4.0);
|
||||||
if !self.final_level {
|
// if !self.final_level {
|
||||||
supplement.add_entity(
|
// supplement.add_entity(
|
||||||
EntityInfo::at((origin + stair_rcenter).map(|e| e as f32) + Vec3::from(offs))
|
// EntityInfo::at((origin + stair_rcenter).map(|e| e as f32)
|
||||||
.into_waypoint(),
|
// + Vec3::from(offs)) .into_waypoint(),
|
||||||
);
|
// );
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
for x in area.min.x..area.max.x {
|
for x in area.min.x..area.max.x {
|
||||||
|
Loading…
Reference in New Issue
Block a user