Skip to content

Commit

Permalink
Add Rollback component to integration test players
Browse files Browse the repository at this point in the history
  • Loading branch information
johanhelsing committed Oct 19, 2023
1 parent a5defd2 commit 062dcce
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ use bevy::{
MinimalPlugins,
};
use bevy_ggrs::{
GgrsPlugin, GgrsSchedule, LocalInputs, LocalPlayers, PlayerInputs, ReadInputs, Rollback,
Session,
AddRollbackCommandExtension, GgrsPlugin, GgrsSchedule, LocalInputs, LocalPlayers, PlayerInputs,
ReadInputs, Rollback, Session,
};
use bytemuck::{Pod, Zeroable};
use ggrs::{Config, P2PSession, PlayerHandle, PlayerType, SessionBuilder, UdpNonBlockingSocket};
Expand Down Expand Up @@ -213,10 +213,12 @@ pub fn spawn_players(mut commands: Commands, session: Res<Session<GgrsConfig>>)
};

for handle in 0..num_players {
commands.spawn((
PlayerComponent { handle },
Velocity::default(),
Transform::default(),
));
commands
.spawn((
PlayerComponent { handle },
Velocity::default(),
Transform::default(),
))
.add_rollback();
}
}

0 comments on commit 062dcce

Please sign in to comment.