Skip to content

Commit

Permalink
various fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Indy2222 committed Feb 20, 2024
1 parent 34abdc7 commit d1b34fb
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion crates/audio/src/spatial.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ fn play(
let camera = camera.single();
let sound_volume = config.audio().sound_volume() as f64;

for PlaySpatialAudioEvent { sound, position } in &mut play_events {
for PlaySpatialAudioEvent { sound, position } in play_events.read() {
let (volume, pan) = calculate_volume_and_pan(camera, &focus, *position);
let handle = audio
.play(sounds.0[*sound].clone())
Expand Down
2 changes: 1 addition & 1 deletion crates/combat/src/trail.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ impl Trail {
}
}

#[derive(AsBindGroup, TypeUuid, TypePath, Debug, Clone)]
#[derive(Asset, AsBindGroup, TypeUuid, TypePath, Debug, Clone)]
#[uuid = "560ab431-1a54-48b3-87ea-8de8d94ceafb"]
struct TrailMaterial {
#[uniform(0)]
Expand Down
2 changes: 1 addition & 1 deletion crates/movement/src/repulsion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ fn setup_entities(
mut commands: Commands,
objects: Query<Entity, (With<MovableSolid>, Without<Repulsion>)>,
) {
for entity in objects.read() {
for entity in objects.iter() {
commands.entity(entity).insert(Repulsion::default());
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/movement/src/syncing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ type NotSetUp = (With<MovableSolid>, With<Local>, Without<SyncTimer>);

fn setup_entities(mut commands: Commands, time: Res<Time>, entities: Query<Entity, NotSetUp>) {
let time = time.elapsed();
for entity in entities.read() {
for entity in entities.iter() {
commands.entity(entity).insert(SyncTimer::new(time));
}
}
Expand Down
6 changes: 3 additions & 3 deletions crates/signs/src/line.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ fn update_line_end(
lines: Res<LineLocations>,
mut line_location: EventWriter<UpdateLineLocationEvent>,
) {
for event in &mut events {
for event in events.read() {
if let Some(old_location) = lines.0.get(&event.owner) {
let location = LineLocation::new(old_location.start, event.end);
line_location.send(UpdateLineLocationEvent::new(event.owner, location));
Expand All @@ -174,7 +174,7 @@ fn update_line_location(
mut transforms: Query<&mut Transform>,
mut line_locations: ResMut<LineLocations>,
) {
for event in &mut events {
for event in events.read() {
line_locations.0.insert(event.owner, event.location);
if let Some(line_entity) = lines.0.get(&event.owner) {
let mut current_transform = transforms.get_mut(*line_entity).unwrap();
Expand All @@ -190,7 +190,7 @@ fn update_line_visibility(
mut commands: Commands,
line_mesh: Res<LineMesh>,
) {
for event in &mut events {
for event in events.read() {
if event.visible && !lines.0.contains_key(&event.owner) {
let transform = line_locations
.0
Expand Down
4 changes: 3 additions & 1 deletion crates/spawner/src/draft.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ impl DraftBundle {
object_type: ObjectType::Active(ActiveObjectType::Building(building_type)).into(),
transform,
global_transform: transform.into(),
..default()
visibility: VisibilityBundle::default(),
draft: DraftAllowed::default(),
ready: DraftReady::default(),
}
}
}
Expand Down

0 comments on commit d1b34fb

Please sign in to comment.