fix: don't show logout message when player never was ingame

This commit is contained in:
timokoesters 2019-10-06 17:34:51 +02:00
parent a0d01c064c
commit 4501fef503
No known key found for this signature in database
GPG Key ID: CD80BE9AAEE78097

View File

@ -1122,7 +1122,11 @@ impl Server {
}
if disconnect {
if let Some(player) = state.ecs().read_storage::<comp::Player>().get(entity) {
if let (Some(player), Some(_)) = (
state.ecs().read_storage::<comp::Player>().get(entity),
// It only shows a message if you had a body (not in char selection)
state.ecs().read_storage::<comp::Body>().get(entity),
) {
new_chat_msgs.push((
None,
ServerMsg::broadcast(format!("{} went offline.", &player.alias)),