Jump to content
  • Advertisement
Sign in to follow this  
Mappy777

Need help implementing a bugfix (OpenGL idiot here)

This topic is 1432 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I have an apperent fix for a bug in my program....
 
diff --git a/Super Millionaire.cpp b/Super Millionaire.cpp
index 04b19f8..a588874 100644
--- a/Super Millionaire.cpp 
+++ b/Super Millionaire.cpp 
@@ -1360,10 +1360,10 @@ void phonep()
    {
        int pres;
 
-       do
-       {
+//     do
+//     {
            pres = (rand() % 10) + 1;
-       } while(answers[qnum][pres - 1] == "");
+//     } while(answers[qnum][pres - 1] == "");
 
        if(pres < 5)
        {
@@ -1384,10 +1384,10 @@ void phonep()
    {
        int pres;
 
-       do
-       {
+//     do
+//     {
            pres = (rand() % 6) + 1;
-       } while(answers[qnum][pres - 1] == "");
+//     } while(answers[qnum][pres - 1] == "");
 
        if(pres < 5)
        {
 
 
Problem is, I don't know how to plug this into the file to make it work... nor do i see any diffrences between this and the actual file. .cpp file is attached... help is greatly appriciated :)
 
 
 

Share this post


Link to post
Share on other sites
Advertisement

The differences appear to be the addition of comments to certain lines of the program. This is called a patch, and there are programs to apply one. This one looks like it was generated with Git. You can see the "context", introduced by "@@" lines surrounding the change, and the lines prefixed by "-", which are to be removed, and the lines prefixed by "+", which means they are added.

 

The code should transform from:

void phonep()
{
    int pres;
 
    do
    {
        pres = (rand() % 10) + 1;
    } while(answers[qnum][pres - 1] == "");
 
    if(pres < 5)
    {
        // Stuff ...
    }
    // More stuff ...
}       

 

To:

void phonep()
{
    int pres;
 
//    do
//    {
        pres = (rand() % 10) + 1;
//    } while(answers[qnum][pres - 1] == "");
 
    if(pres < 5)
    {
        // Stuff ...
    }
    // More stuff ...
} 

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!