PlantCare

20 - Purchase water button not buying a full stack of lvl 55

What steps will reproduce the problem?

1. Go to the OS expert plant vendor and use the purchase water button for lvl 55 water.

What is the expected output? What do you see instead?

I expect a full stack of 250 to be purchased. Instead I get a stack of 245.

What version of the product are you using?

2.07

User When Change
oeginc May 05, 2010 at 01:16 UTC Changed status from Accepted to Fixed
oeginc Apr 30, 2010 at 13:48 UTC Changed status from New to Accepted
oeginc Apr 30, 2010 at 11:51 UTC Changed assigned to from lusiux to oeginc
delve202 Apr 30, 2010 at 09:45 UTC Create

You must login to post a comment. Don't have an account? Register to get one!

  • 3 comments
  • Avatar of delve202 delve202 Apr 30, 2010 at 19:41 UTC - 0 likes

    True, pattern matching is a bit overkill. But I wasn't sure if there was some other reason to use it that I wasn't thinking of.

    Just another world addict with a relapse problem.

  • Avatar of oeginc oeginc Apr 30, 2010 at 13:51 UTC - 0 likes

    Yes, I have verified this and you are exactly correct as to the cause. The fix however is to simply compare the vendor item name to the bag item name (Ie: ==) to make sure they are exact. No point in doing pattern matching on this at all. So this problem is fixed and will be in v2.08.

    During reviewing that code however, I did see some other problems with detecting what items the vendor is selling, and whether or not we should purchase those automatically.

    I'm working on a fix for that. (The original code didn't take into account the fact that there could be more than one water/fertilizer for a specific level).

  • Avatar of delve202 delve202 Apr 30, 2010 at 10:08 UTC - 0 likes

    Reviewing the code and that alt's inventory, I would hazard a guess that the regex at line 1153 needs to be adjusted. It looks like

    string.match(name,PlantCare.Materials.Water [plantlevel][1]))

    is matching against my [Green Leaf Dewdrop]s in inventory. I've got 5 of them on that alt, which makes the math work out just right. I think the following would work better.

    string.match('^' .. name, PlantCare.Materials.Water [plantlevel][1]))

    You might use an end of line anchor on the other side of name as well, but I wouldn't think that's necessary.

  • 3 comments

Facts

Last updated
May 05, 2010
Reported
Apr 30, 2010
Status
Fixed - Developer made requested changes. QA should verify.
Type
Defect - A shortcoming, fault, or imperfection
Priority
Medium - Normal priority.
Votes
0

Reported by

Possible assignees