clear log on death
This commit is contained in:
parent
634482fb73
commit
89984023e9
|
@ -2,7 +2,7 @@ use bevy::prelude::*;
|
|||
use bevy_xpbd_3d::prelude::*;
|
||||
use bevy::scene::SceneInstance;
|
||||
use bevy::math::DVec3;
|
||||
use crate::{actor, audio, chat, commands, effects, nature, settings, world};
|
||||
use crate::{actor, audio, chat, commands, effects, hud, nature, settings, world};
|
||||
|
||||
pub const ENGINE_SPEED_FACTOR: f32 = 30.0;
|
||||
const MIN_INTERACT_DISTANCE: f32 = 30.0;
|
||||
|
@ -386,6 +386,7 @@ fn handle_player_death(
|
|||
mut scene_spawner: ResMut<SceneSpawner>,
|
||||
mut ew_sfx: EventWriter<audio::PlaySfxEvent>,
|
||||
mut ew_effect: EventWriter<effects::SpawnEffectEvent>,
|
||||
mut log: ResMut<hud::Log>,
|
||||
) {
|
||||
for _ in er_playerdies.read() {
|
||||
for entity in &q_noscenes {
|
||||
|
@ -395,6 +396,7 @@ fn handle_player_death(
|
|||
cmd.entity(entity).despawn();
|
||||
scene_spawner.despawn_instance(**sceneinstance);
|
||||
}
|
||||
log.clear();
|
||||
//cmd.run_system(commands::load_defs); // why is it so complicated to get SystemId?
|
||||
ew_sfx.send(audio::PlaySfxEvent(audio::Sfx::WakeUp));
|
||||
ew_effect.send(effects::SpawnEffectEvent {
|
||||
|
|
|
@ -102,6 +102,10 @@ impl Log {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn clear(&mut self) {
|
||||
self.logs.clear();
|
||||
}
|
||||
}
|
||||
|
||||
fn setup(
|
||||
|
|
Loading…
Reference in a new issue