From c4d65094d8e9104e0853470cc5c43b070c9ae4ac Mon Sep 17 00:00:00 2001 From: justin Date: Fri, 3 Apr 2026 14:52:27 +0100 Subject: [PATCH] Fix CloseToMelee bug The problem was not updating the strategy to WarningCry. The whole procedure needs more work. --- src/Dodge/Creature/Perception.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Dodge/Creature/Perception.hs b/src/Dodge/Creature/Perception.hs index b9a3dee47..aae963ac0 100644 --- a/src/Dodge/Creature/Perception.hs +++ b/src/Dodge/Creature/Perception.hs @@ -51,11 +51,13 @@ basicAwarenessUpdate w cr = case _cpAttention $ _crPerception cr of any isCognizant $ IM.unionWith cogRaised oldAwareness newAwareness maybeBecomeCognizant = fromMaybe id $ do guard becomesCognizant +-- guard $ cr ^. crVocalization == VocReady return $ - crActionPlan . apAction + (crActionPlan . apStrategy .~ WarningCry) . + (crActionPlan . apAction .~ [ImpulsesList (crImpulsesOnCognizant w cr) , AimAt 0 (w ^?! cWorld . lWorld . creatures . ix 0 . crPos . _xy) - ] + ]) crImpulsesOnCognizant :: World -> Creature -> [[Impulse]] crImpulsesOnCognizant w cr = case cr ^. crType of