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
- 3 comments
- 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
- Reply
- #3
delve202 Apr 30, 2010 at 19:41 UTC - 0 likesTrue, 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.
- Reply
- #2
oeginc Apr 30, 2010 at 13:51 UTC - 0 likesYes, 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).
- Reply
- #1
delve202 Apr 30, 2010 at 10:08 UTC - 0 likesReviewing 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.