Fix formatting, Update CHANGELOG, turn overflow checks on for dev

profile
This commit is contained in:
Imbris 2019-12-31 03:47:00 -05:00
parent 06ea29bd4c
commit c9caf14877
3 changed files with 28 additions and 21 deletions

View File

@ -47,6 +47,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixed region display name - Fixed region display name
- Fixed the bow fire rate - Fixed the bow fire rate
- Healthbars now flash on critical health - Healthbars now flash on critical health
- Fixed ghosts when going back to character screen
### Removed ### Removed

View File

@ -14,7 +14,7 @@ members = [
# default profile for devs, fast to compile, okay enough to run, no debug information # default profile for devs, fast to compile, okay enough to run, no debug information
[profile.dev] [profile.dev]
opt-level = 2 opt-level = 2
overflow-checks = false overflow-checks = true
debug-assertions = true debug-assertions = true
panic = "abort" panic = "abort"
debug = false debug = false

View File

@ -28,7 +28,7 @@ use common::{
msg::{ClientMsg, ClientState, PlayerListUpdate, ServerError, ServerInfo, ServerMsg}, msg::{ClientMsg, ClientState, PlayerListUpdate, ServerError, ServerInfo, ServerMsg},
net::PostOffice, net::PostOffice,
state::{BlockChange, State, TimeOfDay}, state::{BlockChange, State, TimeOfDay},
sync::{Uid,UidAllocator, WorldSyncExt}, sync::{Uid, UidAllocator, WorldSyncExt},
terrain::{block::Block, TerrainChunkSize, TerrainGrid}, terrain::{block::Block, TerrainChunkSize, TerrainGrid},
vol::{ReadVol, RectVolSize, Vox}, vol::{ReadVol, RectVolSize, Vox},
}; };
@ -36,8 +36,8 @@ use log::{debug, error};
use metrics::ServerMetrics; use metrics::ServerMetrics;
use rand::Rng; use rand::Rng;
use specs::{ use specs::{
join::Join, world::EntityBuilder as EcsEntityBuilder, Builder, Entity as EcsEntity, RunNow, join::Join, saveload::MarkerAllocator, world::EntityBuilder as EcsEntityBuilder, Builder,
SystemData, WorldExt, saveload::MarkerAllocator, Entity as EcsEntity, RunNow, SystemData, WorldExt,
}; };
use std::{ use std::{
i32, i32,
@ -413,8 +413,12 @@ impl Server {
} }
} }
if state
if state.ecs().write_storage::<Client>().get_mut(entity).is_some() { .ecs()
.write_storage::<Client>()
.get_mut(entity)
.is_some()
{
state state
.ecs() .ecs()
.write_storage() .write_storage()
@ -576,7 +580,12 @@ impl Server {
ServerEvent::Respawn(entity) => { ServerEvent::Respawn(entity) => {
// Only clients can respawn // Only clients can respawn
if state.ecs().write_storage::<Client>().get_mut(entity).is_some() { if state
.ecs()
.write_storage::<Client>()
.get_mut(entity)
.is_some()
{
let respawn_point = state let respawn_point = state
.read_component_cloned::<comp::Waypoint>(entity) .read_component_cloned::<comp::Waypoint>(entity)
.map(|wp| wp.get_pos()) .map(|wp| wp.get_pos())
@ -750,15 +759,12 @@ impl Server {
// Easier than checking and removing all other known components // Easier than checking and removing all other known components
// Note: If other `ServerEvent`s are referring to this entity they will be // Note: If other `ServerEvent`s are referring to this entity they will be
// disrupted // disrupted
let maybe_client = let maybe_client = state.ecs().write_storage::<Client>().remove(entity);
state.ecs().write_storage::<Client>().remove(entity); let maybe_uid = state.read_component_cloned::<Uid>(entity);
let maybe_uid = let maybe_player = state.ecs().write_storage::<comp::Player>().remove(entity);
state.read_component_cloned::<Uid>(entity); if let (Some(mut client), Some(uid), Some(player)) =
let maybe_player = (maybe_client, maybe_uid, maybe_player)
state.ecs().write_storage::<comp::Player>().remove(entity); {
if let (Some(mut client), Some(uid), Some(player)) = (
maybe_client, maybe_uid, maybe_player,
) {
// Tell client its request was successful // Tell client its request was successful
client.allow_state(ClientState::Registered); client.allow_state(ClientState::Registered);
// Tell client to clear out other entities and its own components // Tell client to clear out other entities and its own components