summary refs log tree commit diff stats
path: root/src/behaviour_system.cpp
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2021-03-11 16:06:19 -0500
committerStar Rauchenberger <fefferburbia@gmail.com>2021-03-11 17:33:15 -0500
commiteb9fa5020317a44f17cc4906c4c1c6fe55700d3e (patch)
treee4cb67d97818e06d974d0fca987dd76f25affdf9 /src/behaviour_system.cpp
parent4c29543e44deb7a327b21b0af6a85a92e83ff103 (diff)
downloadtanetane-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.cpp2
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 }