mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Avoid using return for skipping respawn events
This commit is contained in:
parent
62abed1eec
commit
996f58ebd2
@ -102,15 +102,12 @@ impl Sys {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
ClientGeneral::ControlEvent(event) => {
|
ClientGeneral::ControlEvent(event) => {
|
||||||
if presence.kind.controlling_char() {
|
if presence.kind.controlling_char() && let Some(controller) = controller {
|
||||||
// Skip respawn if client entity is alive
|
// Skip respawn if client entity is alive
|
||||||
if let ControlEvent::Respawn = event {
|
let skip_respawn = matches!(event, ControlEvent::Respawn)
|
||||||
if healths.get(entity).map_or(true, |h| !h.is_dead) {
|
&& healths.get(entity).map_or(true, |h| !h.is_dead);
|
||||||
//Todo: comment why return!
|
|
||||||
return Ok(());
|
if !skip_respawn {
|
||||||
}
|
|
||||||
}
|
|
||||||
if let Some(controller) = controller {
|
|
||||||
controller.push_event(event);
|
controller.push_event(event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user