What *exact* type (a) does player.getGold() return, and (b) is mGoldRequired defined as? Specifically, are either of them unsigned?

It's not bypassing the if - it's doing it, we have to find out why it's evaluating false instead of true.