forked from StrafesNET/strafe-client
do not set time on idle
This commit is contained in:
parent
394f1f1dc2
commit
b9e34f53c3
@ -1272,6 +1272,7 @@ fn run_teleport_behaviour(wormhole:&Option<gameplay_attributes::Wormhole>,models
|
||||
}
|
||||
|
||||
fn atomic_internal_instruction(state:&mut PhysicsState,data:&PhysicsData,ins:TimedInstruction<PhysicsInternalInstruction>){
|
||||
state.time=ins.time;
|
||||
let should_advance_body=match ins.instruction{
|
||||
PhysicsInternalInstruction::CollisionStart(_)
|
||||
|PhysicsInternalInstruction::CollisionEnd(_)
|
||||
@ -1459,6 +1460,7 @@ fn atomic_internal_instruction(state:&mut PhysicsState,data:&PhysicsData,ins:Tim
|
||||
}
|
||||
|
||||
fn atomic_input_instruction(state:&mut PhysicsState,data:&PhysicsData,ins:TimedInstruction<PhysicsInputInstruction>){
|
||||
state.time=ins.time;
|
||||
let should_advance_body=match ins.instruction{
|
||||
//the body may as well be a quantum wave function
|
||||
//as far as these instruction are concerned (they don't care where it is)
|
||||
@ -1587,8 +1589,9 @@ fn atomic_input_instruction(state:&mut PhysicsState,data:&PhysicsData,ins:TimedI
|
||||
if ins.time<state.time{
|
||||
println!("@@@@ Time travel warning! {:?}",ins);
|
||||
}
|
||||
state.time=ins.time;
|
||||
//idle is special, it is specifically a no-op to get Internal events to catch up to real time
|
||||
match ins.instruction{
|
||||
PhysicsInstruction::Input(PhysicsInputInstruction::Idle)=>(),
|
||||
PhysicsInstruction::Internal(instruction)=>atomic_internal_instruction(state,data,TimedInstruction{time:ins.time,instruction}),
|
||||
PhysicsInstruction::Input(instruction)=>atomic_input_instruction(state,data,TimedInstruction{time:ins.time,instruction}),
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user