Fix bug determining max radius of convex polys, fixes bugs in room positioning

This commit is contained in:
2022-03-21 07:43:27 +00:00
parent 2a5b6d3597
commit d6285c45b3
12 changed files with 80 additions and 32 deletions
+9 -6
View File
@@ -16,13 +16,16 @@ startReloadingWeapon cr = (creatures . ix (_crID cr) . crInv . ix (_crInvSel cr)
icTryStartReloading :: Item -> Maybe Item
icTryStartReloading it = do
am <- it ^? itConsumption
amloaded <- am ^? ammoLoaded
ammax <- am ^? ammoBaseMax
rstate <- am ^? reloadState
am <- it ^? itConsumption
amloaded <- am ^? ammoLoaded
ammax <- am ^? ammoBaseMax
rstate <- am ^? reloadState
if amloaded < ammax && rstate == Nothing'
then Just $ it & itConsumption . reloadState .~ Just' (_reloadTime am)
& if _reloadType am == ActiveClear then itConsumption . ammoLoaded .~ 0 else id
then Just $ it
& itConsumption . reloadState .~ Just' (_reloadTime am)
& if _reloadType am == ActiveClear
then itConsumption . ammoLoaded .~ 0
else id
else Nothing
crStopReloading :: Creature -> Creature