Skip to content

Commit

Permalink
Heavy coins can no longer be collected twice by falling on two hit bl…
Browse files Browse the repository at this point in the history
…ocks

This commit makes it so coins can only be collected once.

The exact issue leading up to this chance is that heavy coins used to be able to be collected twice, when hitting the top of two hit blocks at the same time.

This could be reproduced by having one coin explosion bonus block and another block (of any type), as well as a low ceiling. When hitting both blocks at the same time, some coins would fall in between of those 2 blocks, making them be collected twice, essentially duplicating them. The lower the ceiling is, the higher the chance of this occurring was.
  • Loading branch information
Vankata453 committed Oct 11, 2024
1 parent 8670ba2 commit 9c60305
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/object/coin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,9 @@ Coin::collect()

int tile = static_cast<int>(get_pos().y / 32);

if (!is_valid())
return;

if (!sound_timer.started()) {
pitch_one = tile;
pitch = 1;
Expand Down

0 comments on commit 9c60305

Please sign in to comment.