Fix creature collision bug
This commit is contained in:
+2
-2
@@ -980,10 +980,10 @@ crCrSpring c1 c2
|
||||
| id1 == id2 = id
|
||||
| vec == V2 0 0 = id
|
||||
| diff >= comRad = id
|
||||
| otherwise = cWorld . lWorld . creatures %~ ( olap c1 c2 . olap c2 c1)
|
||||
|
||||
| otherwise = cWorld . lWorld . creatures %~ ( olap c1 c2 . olap' c2 c1)
|
||||
where
|
||||
olap a b = ix (a ^. crID) . crPos . _xy +~ overlap b
|
||||
olap' a b = ix (a ^. crID) . crPos . _xy -~ overlap b
|
||||
id1 = _crID c1
|
||||
id2 = _crID c2
|
||||
vec = c1 ^. crPos . _xy - c2 ^. crPos . _xy
|
||||
|
||||
Reference in New Issue
Block a user