Page 1 of 1

Slight quest bug

PostPosted: Sun Jun 01, 2008 11:13 pm
by Drakia
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.     }

Re: Slight quest bug

PostPosted: Mon Jun 02, 2008 12:51 am
by Arnold
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)

Re: Slight quest bug

PostPosted: Mon Jun 02, 2008 1:06 am
by Drakia
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.

Re: Slight quest bug

PostPosted: Mon Jun 02, 2008 1:42 am
by Drakia
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.

Re: Slight quest bug

PostPosted: Mon Jun 02, 2008 1:57 pm
by PurpleYouko
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.

Re: Slight quest bug

PostPosted: Mon Jun 02, 2008 5:43 pm
by PurpleYouko
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.

Re: Slight quest bug

PostPosted: Mon Jun 02, 2008 6:18 pm
by Drakia
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.

Re: Slight quest bug

PostPosted: Mon Jun 02, 2008 6:20 pm
by PurpleYouko
I think it was Arisa that worked for me.