Slight quest bug

If you want to help us or give some corrections / codes, put it here :)

Moderators: osRose dev team, ospRose dev team, osiRose dev team, Moderators

Slight quest bug

Postby Drakia on Sun Jun 01, 2008 11:13 pm

I was looking through the OSpRose code (Which is mostly based off the latest OSiRose) and came across this in the QuestConditions.cpp file
  1.         if (curItem->iWhere==13)
  2.         {
  3.             for (unsigned int j=0;j<10;j++)
  4.             {
  5.                 for (unsigned int k=0;k<5;k++)
  6.                 {
  7.                     if (client->quest.quests[i].Items[j].itemnum==curItem->uiItemSN)
  8.                     {
  9.                         if(!pquests->OperateValues(curItem->btOp, &client->quest.quests[i].Items[j].count, curItem->iRequestCnt))
  10.                             return QUEST_FAILURE;
  11.                         else
  12.                             return QUEST_SUCCESS;
  13.                     }
  14.                 }
  15.             }
  16.         }


If you look at what the if statements are using, you can see that it's using i and j, instead of j and k like you would think it should. This would make the server change the wrong quest items while the client showed the right amounts being updated. I'm also not sure if there should be a "return QUEST_FAILER" after the for loop, before the main iWhere check completes, since 13 should (As far as I'm aware) only check quest items. Here is code to fix the if's though.

  1.         if (curItem->iWhere==13)
  2.         {
  3.           for (unsigned int j=0;j<10;j++)
  4.           {
  5.               for (unsigned int k=0;k<5;k++)
  6.               {
  7.                   if (client->quest.quests[j].Items[k].itemnum==curItem->uiItemSN)
  8.                   {
  9.                       if(!pquests->OperateValues(curItem->btOp, &client->quest.quests[j].Items[k].count, curItem->iRequestCnt))
  10.                         return QUEST_FAILURE;
  11.                       else
  12.                         return QUEST_SUCCESS;
  13.                   }
  14.               }
  15.           }
  16.     }
My favorite skill is scaring new users away.
If you haven't SEARCHED expect me to yell at you.
Image
Drakia
ospRose dev team
ospRose dev team
 
Posts: 1614
Joined: Tue Sep 18, 2007 6:53 am
Location: Nanaimo, BC, Canada

Re: Slight quest bug

Postby Arnold on Mon Jun 02, 2008 12:51 am

your right about the j k but i think the return QUEST_FAILURE should stay becouse if it fails it should skip to the next quest entry
else there would be no sence to check for the item(most if not all check functions in QuestConditions.cpp only compair values, they don't modify values)
Arnold
osiRose dev
osiRose dev
 
Posts: 340
Joined: Sun Sep 09, 2007 8:50 pm
Location: pebkac

Re: Slight quest bug

Postby Drakia on Mon Jun 02, 2008 1:06 am

I meant I didn't know if a return should be added between lines 15 and 16. Since if the iWhere is 13, it should only check quest items. But I'm not positive on that, so it's probably best left out.
Another thing I noticed, is quest items aren't saved when the user disconnects.
My favorite skill is scaring new users away.
If you haven't SEARCHED expect me to yell at you.
Image
Drakia
ospRose dev team
ospRose dev team
 
Posts: 1614
Joined: Tue Sep 18, 2007 6:53 am
Location: Nanaimo, BC, Canada

Re: Slight quest bug

Postby Drakia on Mon Jun 02, 2008 1:42 am

Hmm, looking at the code it saves the entire SQuestData structure, which should contain the items. It's weird it's not working :/ (Atleast with OSpRose it's not loading the items when you reconnect)

[Edit] Ok, scratch the return, it's not supposed to be there. But changing the i/j to j/k in OSpRose did make quest items save and such.
My favorite skill is scaring new users away.
If you haven't SEARCHED expect me to yell at you.
Image
Drakia
ospRose dev team
ospRose dev team
 
Posts: 1614
Joined: Tue Sep 18, 2007 6:53 am
Location: Nanaimo, BC, Canada

Re: Slight quest bug

Postby PurpleYouko on Mon Jun 02, 2008 1:57 pm

Well spotted.

Mine, at least, is already loading in quest items at startup.
The main problem I had was wit tutorial quests not completing.
I collected my 10 choropies and the quest disappeared from the client window but gave no reward.
Using a debug tool in the quests I can vouch that even after the client window has lost the quest, the server just keep right on logging choropy kills.
On relogging, not only was the quest there again but it had a total of 19 choropies in it.
Need to lookup information on NARose items, skills, quests?
Now featuring a newly completed skill tree for all classes
Formatting fixed for different resolutions
Image

"A Gazelle is nothing but a giraffe plotted logarithmicaly"
User avatar
PurpleYouko
Rose Guru
Rose Guru
 
Posts: 4733
Joined: Fri Aug 10, 2007 2:05 pm

Re: Slight quest bug

Postby PurpleYouko on Mon Jun 02, 2008 5:43 pm

I just did the missing kid quest again after putting in drakia's mods.

First up, I did it with a different kid and it didn't spawn the monster this time.
I don't think this has anything to do with the mods. i suspect only one of the monster kids is supported. try is with the others too. One of them has worked for me before. Chenney doesn't though.
I will look into that in a while.

Logged out and in again. It kept my position in the quest and didn't give me the annoying fairy message again. :D

Also i was able to go back and finish the outstanding tutorial quests and get my rewards. :D

Other quests still seem OK. Living as a true soldier part 2 came back exactly as I left it in my last session.
Need to lookup information on NARose items, skills, quests?
Now featuring a newly completed skill tree for all classes
Formatting fixed for different resolutions
Image

"A Gazelle is nothing but a giraffe plotted logarithmicaly"
User avatar
PurpleYouko
Rose Guru
Rose Guru
 
Posts: 4733
Joined: Fri Aug 10, 2007 2:05 pm

Re: Slight quest bug

Postby Drakia on Mon Jun 02, 2008 6:18 pm

The i/j problem was screwing up which quest the server was affecting, leading to all kinds of weird problems. I'll look into the Missing Kid error next, see if it is that only one is supported so far.
My favorite skill is scaring new users away.
If you haven't SEARCHED expect me to yell at you.
Image
Drakia
ospRose dev team
ospRose dev team
 
Posts: 1614
Joined: Tue Sep 18, 2007 6:53 am
Location: Nanaimo, BC, Canada

Re: Slight quest bug

Postby PurpleYouko on Mon Jun 02, 2008 6:20 pm

I think it was Arisa that worked for me.
Need to lookup information on NARose items, skills, quests?
Now featuring a newly completed skill tree for all classes
Formatting fixed for different resolutions
Image

"A Gazelle is nothing but a giraffe plotted logarithmicaly"
User avatar
PurpleYouko
Rose Guru
Rose Guru
 
Posts: 4733
Joined: Fri Aug 10, 2007 2:05 pm


Return to Submit Code

Who is online

Users browsing this forum: No registered users and 1 guest