The
Remove the lambda, remove the parameters from
It will now be connected with no out of date arguments as it gets the current values itself at the point the button is clicked.
self.move.clicked.connect
doesn't need to be in diceRoll
at all, place it in the setup code not the event code, just like you have self.roll.clicked.connect
players
does not need passing to the method self.move_players
it can access the current player directly from self.currPl
spaces
can be set as an instance variable in diceRoll
, self.move_players
can then access the current spaces directly from self.spaces
Remove the lambda, remove the parameters from
self.move_players
and connect directly to self.move_players
.It will now be connected with no out of date arguments as it gets the current values itself at the point the button is clicked.