Description of the bug
If you have Spare Trousers Joker and you play a hand with either two pair or flush house, it increases the value of Spare Trousers, as it should.
However, if you have Spare Trousers Joker and you play a hand with a regular flush that happens to contain two pairs in it, it does not increase the value of Spare Trousers as it should.
Additionally, one thing you might want to consider is that when calculating the hand with Spare Trousers in it, Spare Trousers updates first before the score is calculated. You're not currently doing that.
Description of the bug If you have Spare Trousers Joker and you play a hand with either two pair or flush house, it increases the value of Spare Trousers, as it should.
However, if you have Spare Trousers Joker and you play a hand with a regular flush that happens to contain two pairs in it, it does not increase the value of Spare Trousers as it should.
Additionally, one thing you might want to consider is that when calculating the hand with Spare Trousers in it, Spare Trousers updates first before the score is calculated. You're not currently doing that.