Skip to content

Commit

Permalink
feat: counter-attacks
Browse files Browse the repository at this point in the history
  • Loading branch information
mgerhold committed Nov 2, 2024
1 parent 082f69d commit 2642c88
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/simulator/tetrion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,18 @@ std::optional<GarbageSendEvent> ObpfTetrion::simulate_next_frame(KeyState const

++m_next_frame;

while (garbage_lines_to_send > 0 and not m_garbage_receive_queue.empty()) {
--m_garbage_receive_queue.front().num_lines;
if (m_garbage_receive_queue.front().num_lines == 0) {
m_garbage_receive_queue.pop_front();
}
--garbage_lines_to_send;
}

if (garbage_lines_to_send == 0) {
return std::nullopt;
}

return std::optional{
GarbageSendEvent{ m_next_frame, garbage_lines_to_send }
};
Expand Down

0 comments on commit 2642c88

Please sign in to comment.