merged p_teleport.cpp from coleckers/gzdoom/master