Merge branch 'sharp/fix-redundant-code' into 'master'

Removed redundant code missed in auth merge.

See merge request veloren/veloren!1404
This commit is contained in:
Joshua Yanovski 2020-09-22 16:27:04 +00:00
commit 98c8240879

View File

@ -1,6 +1,5 @@
use crate::{
client::Client, persistence::PersistedComponents, settings::ServerSettings,
sys::sentinel::DeletedEntities, SpawnPoint,
client::Client, persistence::PersistedComponents, sys::sentinel::DeletedEntities, SpawnPoint,
};
use common::{
character::CharacterId,
@ -192,18 +191,6 @@ impl StateExt for State {
player.character_id = Some(character_id);
});
// Give the Admin component to the player if their name exists in admin list
if self.ecs().fetch::<ServerSettings>().admins.contains(
&self
.ecs()
.read_storage::<comp::Player>()
.get(entity)
.expect("Failed to fetch entity.")
.alias,
) {
self.write_component(entity, comp::Admin);
}
// Tell the client its request was successful.
if let Some(client) = self.ecs().write_storage::<Client>().get_mut(entity) {
client.allow_state(ClientState::Character);