delete replay on StopSpectate
This commit is contained in:
parent
b28fa25279
commit
e6d1d69241
@ -266,8 +266,15 @@ impl InstructionConsumer<Instruction<'_>> for Session{
|
|||||||
self.view_state=ViewState::Replay(bot_id);
|
self.view_state=ViewState::Replay(bot_id);
|
||||||
},
|
},
|
||||||
Instruction::Control(SessionControlInstruction::StopSpectate)=>{
|
Instruction::Control(SessionControlInstruction::StopSpectate)=>{
|
||||||
|
let view_state=core::mem::replace(&mut self.view_state,ViewState::Play);
|
||||||
|
// delete the bot, otherwise it's inaccessible and wastes CPU
|
||||||
|
match view_state{
|
||||||
|
ViewState::Play=>(),
|
||||||
|
ViewState::Replay(bot_id)=>{
|
||||||
|
self.replays.remove(&bot_id);
|
||||||
|
},
|
||||||
|
}
|
||||||
_=self.simulation.timer.set_paused(ins.time,false);
|
_=self.simulation.timer.set_paused(ins.time,false);
|
||||||
self.view_state=ViewState::Play;
|
|
||||||
},
|
},
|
||||||
Instruction::Playback(_)=>{
|
Instruction::Playback(_)=>{
|
||||||
println!("[session] todo: Playback instructions");
|
println!("[session] todo: Playback instructions");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user