Fix creature collision bug

This commit is contained in:
2026-03-30 23:42:14 +01:00
parent c66b2fb299
commit ab04516279
2 changed files with 93 additions and 92 deletions
+2 -2
View File
@@ -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