Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Indy2222 committed Aug 15, 2023
1 parent adb12b4 commit 904ae01
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
7 changes: 0 additions & 7 deletions crates/construction/src/manufacturing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -377,24 +377,17 @@ fn check_spawn_locations(

fn produce(
time: Res<Time>,
conf: Res<GameConfig>,
counter: Res<ObjectCounter>,
mut factories: Query<(Entity, &Player, &mut AssemblyLine)>,
mut deliver_events: EventWriter<DeliverEvent>,
) {
let locals = conf.locals();

let mut counts: AHashMap<Player, u32> = AHashMap::from_iter(
counter
.counters()
.map(|(&player, counter)| (player, counter.unit_count())),
);

for (factory, &player, mut assembly) in factories.iter_mut() {
if !locals.is_local(player) {
continue;
}

let player_count = counts.entry(player).or_default();

loop {
Expand Down
2 changes: 1 addition & 1 deletion crates/core/src/player.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pub enum Player {
impl Player {
pub const MAX_PLAYERS: usize = 4;

pub const fn to_num(self) -> u8 {
pub fn to_num(self) -> u8 {
match self {
Self::Player1 => 1,
Self::Player2 => 2,
Expand Down

0 comments on commit 904ae01

Please sign in to comment.