Please be aware of the Forum Rules of Conduct.
I updated that part of the code, there's now a bigger chance for parties to continue shopping elsewhere if they still have money.