Pulled from ioquake3