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

Support multiple cheat codes with the same first letter #96

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jummy0
Copy link
Contributor

@jummy0 jummy0 commented Feb 9, 2021

Previously, every cheat code required a unique first letter. This was stated in event.cxx near the definition of cheat_code:
"Toutes les premières lettres doivent être différentes !"
[All the first letters must be different!]

Right now, this change has no effect without adding new cheats.

This will have a greater effect for Speedy Blupi 2, as there are already 25 cheat codes ("V" is the only unused letter).

… first letter

Previously, every cheat code required a unique first letter. This was stated in `event.cxx` near the definition of `cheat_code`:
*"Toutes les premières lettres doivent être différentes !"*
[All the first letters must be different!]

Right now, this change has no effect without adding new cheats.

This will have a greater effect for Speedy Blupi 2, as there are already 25 cheat codes ("V" is the only unused letter).
// être différentes !

static char cheat_code[9][20] = {
static char cheat_code[MAXCHEAT][CHEATLENGTH] = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a very old and ugly original code. You should prefer "modern" stuff like std::array/std::vector with std::string when replacing old stuff.

c++; // CONSTRUIRE ?
if ((char) event.key.keysym.sym == c)
bIncrement = false;
for (i = 0; i < MAXCHEAT; i++)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then with std::array/std::vector we can use a for..rang loop instead of all these ugly for loop based on defines

Copy link
Member

@Skywalker13 Skywalker13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nevertheless it looks like a good work.. Thanks for that

@jummy0 jummy0 marked this pull request as draft February 12, 2021 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants