From 9b656a31522da9fb23f940a4dcd3892973999a3a Mon Sep 17 00:00:00 2001 From: SMUnlimited Date: Mon, 13 Nov 2023 17:31:56 +0000 Subject: [PATCH] #186 Fix to ensure shredder is not highest priorty over normal peons or ghouls --- common.eai | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/common.eai b/common.eai index 53f157b36..6f8f8d17f 100644 --- a/common.eai +++ b/common.eai @@ -10419,8 +10419,12 @@ function ShredderBuilder takes nothing returns nothing local real g = GetGold() local real w = Max(GetWood(),1) local real gdivw = g / w - if neutral_available[NEUTRAL_OBSERVATORY] and gdivw > 4 and g - w > 500 and w < 550 and ai_time - available_time[neutral_shredder] >= -1 then - call BuildUnit(1, neutral_shredder, peon_prio) + if neutral_available[NEUTRAL_OBSERVATORY] and gdivw > 4 and g - w > 500 and w < 550 and g > GetUnitGoldCost2(neutral_shredder) and w > GetUnitWoodCost2(neutral_shredder) and ai_time - available_time[neutral_shredder] >= -1 then + if (race_has_ghouls) then + call BuildUnit(1, neutral_shredder, ghoul_prio - 4) + else + call BuildUnit(1, neutral_shredder, peon_prio - 10) + endif endif endfunction