applied patches from teeworlds/teeworlds#1002