From 80424cf24c44bc9461efbafcc17e343e377757b5 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Tue, 14 Jan 2025 21:40:46 -0800 Subject: [PATCH] spawn on map change --- strafe-client/src/session.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/strafe-client/src/session.rs b/strafe-client/src/session.rs index 3f704c3..96fde2f 100644 --- a/strafe-client/src/session.rs +++ b/strafe-client/src/session.rs @@ -1,3 +1,4 @@ +use strafesnet_common::gameplay_modes::{ModeId,StageId}; use strafesnet_common::instruction::{InstructionConsumer,InstructionEmitter,InstructionFeedback,TimedInstruction}; // session represents the non-hardware state of the client. // Ideally it is a deterministic state which is atomically updated by instructions, same as the simulation state. @@ -159,7 +160,13 @@ impl InstructionConsumer> for Session{ // what if they pause for 5ms lmao _=self.simulation.timer.set_paused(ins.time,paused); } - Instruction::ChangeMap(complete_map)=>self.change_map(complete_map), + Instruction::ChangeMap(complete_map)=>{ + self.change_map(complete_map); + // ResetAndSpawn + run_mouse_interpolator_instruction!(MouseInterpolatorInstruction::Other(OtherInstruction::Mode(ModeInstruction::Reset))); + run_mouse_interpolator_instruction!(MouseInterpolatorInstruction::Other(OtherInstruction::Other(OtherOtherInstruction::SetSensitivity(self.user_settings().calculate_sensitivity())))); + run_mouse_interpolator_instruction!(MouseInterpolatorInstruction::Other(OtherInstruction::Mode(ModeInstruction::Spawn(ModeId::MAIN,StageId::FIRST)))); + }, }; // run all buffered instruction produced self.process_exhaustive(ins.time);