Skip to content

Commit

Permalink
Check entities against collides-p
Browse files Browse the repository at this point in the history
  • Loading branch information
Shinmera committed Jul 7, 2019
1 parent c845845 commit b1b8e10
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions chunk.lisp
Expand Up @@ -301,9 +301,11 @@ void main(){
(when (and (not (eq entity target))
(typep entity 'solid))
(let ((hit (scan entity target)))
(when (and hit (or (null result)
(< (vsqrdist2 pos (hit-location hit))
(vsqrdist2 pos (hit-location result)))))
(when (and hit
(collides-p target entity hit)
(or (null result)
(< (vsqrdist2 pos (hit-location hit))
(vsqrdist2 pos (hit-location result)))))
(setf result hit)))))
(when result
(collide target (hit-object result) result)
Expand Down

0 comments on commit b1b8e10

Please sign in to comment.