Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[N64 Bug] Bug in calculating kills for KillMaster medals #517

Open
jonaeru opened this issue Oct 6, 2024 · 0 comments
Open

[N64 Bug] Bug in calculating kills for KillMaster medals #517

jonaeru opened this issue Oct 6, 2024 · 0 comments
Labels
n64 bug bug that exists in the original game

Comments

@jonaeru
Copy link

jonaeru commented Oct 6, 2024

It was in the decomp comment and I found it interesting so I added the issue.
There is a bug in the calculation of the number of kills for KillMaster medals. Essentially, the number of suicides must be excluded.

alone, always excludes the number of player 2 killed
2 human, always excludes the number of player 3 killed
3 human, always excludes the number of player 4 killed
4 human, always excludes the number of first simulant killed

https://github.com/fgsfdsfgs/perfect_dark/blob/port/src/game/mplayer/mplayer.c#L2351-L2364

				for (j = 0; j < MAX_MPCHRS; j++) {
					// @bug: i should be k. The value of i was incremented after
					// the last iteration of its loop above so it'll be between
					// 1 and 4 inclusively depending on the number of players.
					// The bot nums start from 4 regardless of how many players
					// there are. So in a game with 4 humans, the kills on the
					// first bot will not be considered for the killmaster medal
					// which means the medal could go to a player who got fewer
					// total kills. Additionally, suicides are counted as kills
					// while the intention here was to omit them.
					if (i != j) {
						totalkills += mpchr->killcounts[j];
					}
				}
@fgsfdsfgs fgsfdsfgs added the n64 bug bug that exists in the original game label Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
n64 bug bug that exists in the original game
Projects
None yet
Development

No branches or pull requests

2 participants