bsnes/sfc/controller/justifier/justifier.cpp: probably unintended `player2` instead of `player1` in `player1`-related statement group
Marat-Tanalin opened this issue · 2 comments
Potential typo in bsnes/sfc/controller/justifier/justifier.cpp
. The code contains two groups of similar statements, first group sets properties of player1
, second group does the same for player2
:
player1.x = 256 / 2;
player1.y = 240 / 2;
player1.trigger = false;
player2.start = false;
player2.x = 256 / 2;
player2.y = 240 / 2;
player2.trigger = false;
player2.start = false;
But the last line of the first group contains player2
instead of player1
. This might be a bug, not just because of obvious grouping, but also given that the second group contains the same statement player2.start = false;
too, and such duplication is unlikely intentional.
Looks like this change was introduced in v084r05 (6227974), and probably has gone unnoticed for this long because these defaults are immediately overwritten as soon as the game reads the emulated controller state (and bsnes polls its mapped controllers).
It should probably still be fixed, though.
I agree with Screwtape; why not turn player1
and player2
into two elements of an array while we're at it? Copypasta is how these kinds of mistakes happen, in my experience.