ported 2556d9d30c to singleplayer