diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2021-03-11 16:06:19 -0500 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2021-03-11 17:33:15 -0500 |
commit | eb9fa5020317a44f17cc4906c4c1c6fe55700d3e (patch) | |
tree | e4cb67d97818e06d974d0fca987dd76f25affdf9 /src/behaviour_system.cpp | |
parent | 4c29543e44deb7a327b21b0af6a85a92e83ff103 (diff) | |
download | tanetane-eb9fa5020317a44f17cc4906c4c1c6fe55700d3e.tar.gz tanetane-eb9fa5020317a44f17cc4906c4c1c6fe55700d3e.tar.bz2 tanetane-eb9fa5020317a44f17cc4906c4c1c6fe55700d3e.zip |
Simplified collision detection output
It is no longer split into horizontal and vertical results. Also, the collision detection routine now does the work of calculating an adjusted position, instead of the caller (CharacterSystem) having to do it. This will be useful for #3.
Diffstat (limited to 'src/behaviour_system.cpp')
-rw-r--r-- | src/behaviour_system.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/behaviour_system.cpp b/src/behaviour_system.cpp index f4f7546..ce980f6 100644 --- a/src/behaviour_system.cpp +++ b/src/behaviour_system.cpp | |||
@@ -196,7 +196,7 @@ void BehaviourSystem::createPath(int spriteId) { | |||
196 | } | 196 | } |
197 | 197 | ||
198 | CollisionResult collision = game_.getSystem<TransformSystem>().checkCollision(spriteId, searchNode.point, newPos, dir); | 198 | CollisionResult collision = game_.getSystem<TransformSystem>().checkCollision(spriteId, searchNode.point, newPos, dir); |
199 | if (collision.horiz.blocked || collision.vert.blocked) { | 199 | if (collision.blocked) { |
200 | // There isn't actually an edge to this neighbor. | 200 | // There isn't actually an edge to this neighbor. |
201 | continue; | 201 | continue; |
202 | } | 202 | } |