@@ -859,7 +859,6 @@ execConst c vs s k = do
859
859
-- either robot's inventory
860
860
when (focusedID == myID || focusedID == otherID) flagRedraw
861
861
862
- updateInstalledDevice item
863
862
return $ Out VUnit s k
864
863
_ -> badConst
865
864
Make -> case vs of
@@ -1371,7 +1370,7 @@ execConst c vs s k = do
1371
1370
[VBool b] -> return $ Out (VBool (not b)) s k
1372
1371
_ -> badConst
1373
1372
Neg -> case vs of
1374
- [VInt n] -> return $ Out (VInt (- n)) s k
1373
+ [VInt n] -> return $ Out (VInt (- n)) s k
1375
1374
_ -> badConst
1376
1375
Eq -> returnEvalCmp
1377
1376
Neq -> returnEvalCmp
@@ -1643,23 +1642,9 @@ updateDiscoveredEntities e = do
1643
1642
then pure ()
1644
1643
else do
1645
1644
let newAllDiscovered = E. insertCount 1 e allDiscovered
1646
- allDevices <- use allInstalledDevices
1647
- updateAvailableRecipes (newAllDiscovered, allDevices) e
1645
+ updateAvailableRecipes (newAllDiscovered, newAllDiscovered) e
1648
1646
allDiscoveredEntities .= newAllDiscovered
1649
1647
1650
- -- | Update the global list of installed devices, and check for new recipes.
1651
- updateInstalledDevice :: (Has (State GameState ) sig m , Has (State Robot ) sig m ) => Entity -> m ()
1652
- updateInstalledDevice e = do
1653
- allDevices <- use allInstalledDevices
1654
- if E. contains0plus e allDevices
1655
- then pure ()
1656
- else do
1657
- let newAllDevices = E. insertCount 1 e allDevices
1658
- -- Check every known entities to see if the new device enables new recipes
1659
- allDiscovered <- use allDiscoveredEntities
1660
- traverse_ (updateAvailableRecipes (allDiscovered, newAllDevices) . snd ) (elems allDiscovered)
1661
- allInstalledDevices .= newAllDevices
1662
-
1663
1648
-- | Update the availableRecipes list.
1664
1649
-- This implementation is not efficient:
1665
1650
-- * Every time we discover a new entity, we iterate through the entire list of recipes to see which ones we can make.
0 commit comments