Need help implementing a bugfix (OpenGL idiot here)

Started by
0 comments, last by rip-off 9 years, 5 months ago
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 :)
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 ...
} 

This topic is closed to new replies.

Advertisement