From f58907eb93529d809dfc39ed2256456c3cc81f2c Mon Sep 17 00:00:00 2001 From: DarthMooMancer Date: Thu, 4 Sep 2025 19:25:16 -0400 Subject: [PATCH] fix: fixed collision of pipe where it only did the first and not all pipes --- src/main.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 20e84f1..c2ce2a3 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -40,11 +40,13 @@ int main() { if(pipes.front().m_nodes->m_col < 3) { _delete_pipe(pipes); } - for(int i = 0; i < pipes.front().m_size; i++) { - if(pipes.front().m_nodes[i].m_col == bird.m_body.m_col) { - if(pipes.front().m_nodes[i].m_row == bird.m_body.m_row) { - running = false; - std::cout << "You died!" << std::endl; + for(int j = 0; j < pipes.size(); j++) { + for(int i = 0; i < pipes.front().m_size; i++) { + if(pipes.at(j).m_nodes[i].m_col == bird.m_body.m_col) { + if(pipes.at(j).m_nodes[i].m_row == bird.m_body.m_row) { + running = false; + std::cout << "You died!" << std::endl; + } } } }