From eb9fa5020317a44f17cc4906c4c1c6fe55700d3e Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Thu, 11 Mar 2021 16:06:19 -0500 Subject: 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. --- src/behaviour_system.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/behaviour_system.cpp') 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) { } CollisionResult collision = game_.getSystem().checkCollision(spriteId, searchNode.point, newPos, dir); - if (collision.horiz.blocked || collision.vert.blocked) { + if (collision.blocked) { // There isn't actually an edge to this neighbor. continue; } -- cgit 1.4.1