reset building lvl if destroyed

This commit is contained in:
weiss
2020-04-12 06:59:30 +02:00
parent b18c0a636f
commit b40d24f69c

View File

@@ -68,7 +68,9 @@ loop numSites siteInfo gameState = do
Just gs -> head $ filter (\s -> s.id == infoS.id) gs.sites
Nothing -> Nothing
let lvl = case prevSite of
Just site -> site.lvl
Just pSite -> if protoS.owner /= 0
then 0 -- reset level of all buildings, which are not (any longer) ours
else pSite.lvl
Nothing -> 0
pure { id: protoS.id
, gold: protoS.gold