From ee92230176892c553856a428390762856c7abf6d Mon Sep 17 00:00:00 2001 From: deathride58 Date: Mon, 30 May 2022 22:08:49 -0400 Subject: [PATCH] Moves newplayer button population to a dedicated proc, significantly reducing the hackiness involved for getting the agegate working proper --- code/_onclick/hud/new_player.dm | 7 ++----- code/modules/mob/dead/new_player/login.dm | 10 ++++++++++ code/modules/mob/dead/new_player/new_player.dm | 5 ++++- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/code/_onclick/hud/new_player.dm b/code/_onclick/hud/new_player.dm index a56e6414a7..b426db1aac 100644 --- a/code/_onclick/hud/new_player.dm +++ b/code/_onclick/hud/new_player.dm @@ -1,10 +1,6 @@ /datum/hud/new_player -/datum/hud/new_player/New(mob/dead/new_player/owner) - ..() - //This shouldn't happen like this but, age_verify sleeps, and they'll get the buttons when it's done. - if (!owner.age_verify()) - return +/datum/hud/new_player/proc/populate_buttons(mob/dead/new_player/owner) var/list/buttons = subtypesof(/atom/movable/screen/lobby) for(var/button_type in buttons) var/atom/movable/screen/lobby/lobbyscreen = new button_type() @@ -14,6 +10,7 @@ if(istype(lobbyscreen, /atom/movable/screen/lobby/button)) var/atom/movable/screen/lobby/button/lobby_button = lobbyscreen lobby_button.owner = REF(owner) + show_hud(hud_version) /atom/movable/screen/lobby plane = SPLASHSCREEN_PLANE diff --git a/code/modules/mob/dead/new_player/login.dm b/code/modules/mob/dead/new_player/login.dm index af840fafc3..dbcc2cb2b4 100644 --- a/code/modules/mob/dead/new_player/login.dm +++ b/code/modules/mob/dead/new_player/login.dm @@ -9,6 +9,12 @@ ..() + if(!age_verify()) + return + + if(!client) //client can end up null as a result of age_verify() kicking those who fail + return + var/motd = global.config.motd if(motd) to_chat(src, "
[motd]
", handle_whitespace=FALSE) @@ -35,3 +41,7 @@ else postfix = "soon" to_chat(src, "Please set up your character and select \"Ready\". The game will start [postfix].") + + var/datum/hud/new_player/NH = hud_used + if(istype(NH)) + NH.populate_buttons(src) diff --git a/code/modules/mob/dead/new_player/new_player.dm b/code/modules/mob/dead/new_player/new_player.dm index d3d0af1d91..3441810d0d 100644 --- a/code/modules/mob/dead/new_player/new_player.dm +++ b/code/modules/mob/dead/new_player/new_player.dm @@ -89,6 +89,9 @@ if(!(client.prefs.db_flags & DB_FLAG_AGE_CONFIRMATION_INCOMPLETE)) //completed? Skip return TRUE + if(!client) + return FALSE + var/age_verification = age_gate() //ban them and kick them if(age_verification != 1) @@ -165,7 +168,7 @@ return 0 //don't let people get to this unless they are specifically not verified - if(href_list["Month"] && (CONFIG_GET(flag/age_verification) && !check_rights_for(client, R_ADMIN) && !(client.ckey in GLOB.bunker_passthrough))) + if(href_list["Month"] && (CONFIG_GET(flag/age_verification) && /*!check_rights_for(client, R_ADMIN) &&*/ !(client.ckey in GLOB.bunker_passthrough))) var/player_month = text2num(href_list["Month"]) var/player_year = text2num(href_list["Year"])