Jump to content

Seen Shop System


Recommended Posts

  • 9 months later...
  • Honorable Member
On 13.07.2017 at 1:42 AM, Denis said:

Wouldn't it be better to store the "Guests" inside a vector and then check if the guest already exists in it, if yes don't add the guest to vector, if no add it to vector then send to client?

I'm just narrow-minded when it comes to quest flags haha :D

You're right.I updated topic.

 

Link to comment
Share on other sites

  • Honorable Member
18 hours ago, DeadSkull7 said:

Good job but i think if same player open shop don't increment seens counter will be better.Also, why you use vector ? And push every time ? in you case you don't want to chack if player opened shop or no to increment counter ! You can use single counter not vector.


int counter = 0;

 

-And push every time ?

Wrong! Not every time if ch isn't exist in vector control:

find(looked.begin(), looked.end(), ch) == looked.end()

 

Link to comment
Share on other sites

  • Honorable Member
4 minutes ago, DeadSkull7 said:

So if player open shop in first time you push him in vector, if open again ? He will be existed so vector size don't change .. ?

Yes, size only change for 1 character.

 

Link to comment
Share on other sites

  • 3 years later...
  • 5 months later...
  • 2 years later...

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.