Continue to refactor zoning to be more stream-based
This commit is contained in:
+6
-6
@@ -366,14 +366,14 @@ crSpring c w = IM.foldl' (flip $ crCrSpring c) w cs
|
||||
cs = creaturesNearPoint (_crPos c) w
|
||||
|
||||
crCrSpring :: Creature -> Creature -> World -> World
|
||||
crCrSpring c1 c2 w
|
||||
| id1 == id2 = w
|
||||
| vec == V2 0 0 = w
|
||||
| diff >= comRad = w
|
||||
| otherwise = over creatures
|
||||
crCrSpring c1 c2
|
||||
| id1 == id2 = id
|
||||
| vec == V2 0 0 = id
|
||||
| diff >= comRad = id
|
||||
| otherwise = creatures %~
|
||||
( over (ix id1 . crPos) (+.+ overlap1)
|
||||
. over (ix id2 . crPos) (-.- overlap2)
|
||||
) w
|
||||
)
|
||||
where
|
||||
id1 = _crID c1
|
||||
id2 = _crID c2
|
||||
|
||||
Reference in New Issue
Block a user