local playersforexittable = {FRACUNIT/4, FRACUNIT/2, FRACUNIT*3/4, FRACUNIT} local hurrytable = {FRACUNIT*3/4, 1, FRACUNIT/2, FRACUNIT/3, FRACUNIT/4, FRACUNIT*2/3} addHook("ThinkFrame", do if not (server and netgame and gamemap == 26) then return end local mapheader = mapheaderinfo[26] if not (mapheader.lvlttl == "Black Core" and mapheader.actnum == 2) then return end local playersforexit = CV_FindVar("playersforexit").value local hurry_players = CV_FindVar("hurry_players") and CV_FindVar("hurry_players").value+1 local playercount = 0 local readycount = 0 for p in players.iterate if not (p.mo and p.mo.valid) then continue end playercount = $+1 if #p.mo.subsector.sector == 111 or (#p.mo.subsector.sector == 113 and p.mo.z < -1920*FRACUNIT) readycount = $+1 end end if readycount and playercount and (not playersforexit or readycount*FRACUNIT/playercount >= playersforexittable[playersforexit] or (hurry_players and readycount*FRACUNIT/playercount >= hurrytable[hurry_players])) for p in players.iterate if not (p.mo and p.mo.valid) then continue end if p.playerstate ~= PST_LIVE G_DoReborn(#p) continue end if not (#p.mo.subsector.sector == 111 or (#p.mo.subsector.sector == 113 and p.mo.z < -1920*FRACUNIT)) P_TeleportMove(p.mo, -14080*FRACUNIT, 1728*FRACUNIT, -1920*FRACUNIT) end P_ResetPlayer(p) end end end)