From 8403cb2d0d0381fcebabf5b9cf832adbc4221810 Mon Sep 17 00:00:00 2001 From: InfinityDevTech <47366052+InfinityDevTech@users.noreply.github.com> Date: Tue, 1 Oct 2024 23:53:14 -0400 Subject: [PATCH] Fix expansion --- src/combat/goals/room_claim.rs | 5 +++-- src/lib.rs | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/combat/goals/room_claim.rs b/src/combat/goals/room_claim.rs index 780fd43..a02b419 100644 --- a/src/combat/goals/room_claim.rs +++ b/src/combat/goals/room_claim.rs @@ -250,14 +250,15 @@ fn achieve_goal(goal_room: &RoomName, memory: &mut ScreepsMemory, cache: &mut Ro let xy = new_xy(x, y); let score = available_positions.get(xy); + let mut should_continue = false; for exit in &xy_exits { if exit.get_range_to(xy) <= 8 { - continue; + should_continue = true; } } - if score >= 7 { + if score >= 7 && !should_continue { available_xy.push(xy); } } diff --git a/src/lib.rs b/src/lib.rs index b953252..423e7ee 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -147,7 +147,7 @@ pub fn game_loop() { memory.stats.cpu.rooms = game::cpu::get_used() - pre_room_cpu - cache.creep_cpu; info!("[GOVERNMENT] Global government execution took {:.2} CPU for {} rooms.", game::cpu::get_used() - pre_room_cpu, game::rooms().keys().count()); - if game::time() % 1500 == 0 { + if game::time() % 100 == 0 { for room in memory.rooms.clone().keys() { let groom = game::rooms().get(*room);