Fix CloseToMelee bug

The problem was not updating the strategy to WarningCry.
The whole procedure needs more work.
This commit is contained in:
2026-04-03 14:52:27 +01:00
parent 532628c6da
commit c4d65094d8
+4 -2
View File
@@ -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