Avoid some code duplication. Thanks to sachith500.
Merge branch 'master' of https://github.com/supertuxkart/stk-code