[MIRROR] Fixes issues where players can enter the game without accepted interviews. [MDB IGNORE] (#14153)

* Fixes issues where players can enter the game without accepted interviews.

* Update login.dm

Co-authored-by: Timberpoes <silent_insomnia_pp@hotmail.co.uk>
Co-authored-by: Gandalf <9026500+Gandalf2k15@users.noreply.github.com>
This commit is contained in:
SkyratBot
2022-06-08 02:13:31 +01:00
committed by GitHub
co-authored by Timberpoes Gandalf
parent 30f6add307
commit 44df188a33
3 changed files with 30 additions and 10 deletions
+15 -1
View File
@@ -3,8 +3,13 @@
/datum/hud/new_player/New(mob/owner)
..()
if (owner?.client?.interviewee)
if(!owner || !owner.client)
return
if (owner.client.interviewee)
return
var/list/buttons = subtypesof(/atom/movable/screen/lobby)
for(var/button_type in buttons)
var/atom/movable/screen/lobby/lobbyscreen = new button_type()
@@ -42,6 +47,9 @@
if(owner != REF(usr))
return
if(!usr.client || usr.client.interviewee)
return
. = ..()
if(!enabled)
@@ -55,6 +63,9 @@
if(owner != REF(usr))
return
if(!usr.client || usr.client.interviewee)
return
. = ..()
highlighted = TRUE
update_appearance(UPDATE_ICON)
@@ -63,6 +74,9 @@
if(owner != REF(usr))
return
if(!usr.client || usr.client.interviewee)
return
. = ..()
highlighted = FALSE
update_appearance(UPDATE_ICON)
+13 -8
View File
@@ -10,6 +10,13 @@
mind.active = TRUE
mind.set_current(src)
// Check if user should be added to interview queue
if (!client.holder && CONFIG_GET(flag/panic_bunker) && CONFIG_GET(flag/panic_bunker_interview) && !(client.ckey in GLOB.interviews.approved_ckeys))
var/required_living_minutes = CONFIG_GET(number/panic_bunker_living)
var/living_minutes = client.get_exp_living(TRUE)
if (required_living_minutes >= living_minutes)
client.interviewee = TRUE
. = ..()
if(!. || !client)
return FALSE
@@ -39,14 +46,12 @@
var/datum/asset/asset_datum = get_asset_datum(/datum/asset/simple/lobby)
asset_datum.send(client)
// Check if user should be added to interview queue
if (!client.holder && CONFIG_GET(flag/panic_bunker) && CONFIG_GET(flag/panic_bunker_interview) && !(client.ckey in GLOB.interviews.approved_ckeys))
var/required_living_minutes = CONFIG_GET(number/panic_bunker_living)
var/living_minutes = client.get_exp_living(TRUE)
if (required_living_minutes >= living_minutes)
client.interviewee = TRUE
register_for_interview()
return
// The parent call for Login() may do a bunch of stuff, like add verbs.
// Delaying the register_for_interview until the very end makes sure it can clean everything up
// and set the player's client up for interview.
if(client.interviewee)
register_for_interview()
return
if(SSticker.current_state < GAME_STATE_SETTING_UP)
var/tl = SSticker.GetTimeLeft()
@@ -487,5 +487,6 @@
if (I)
I.ui_interact(src)
// Add verb for re-opening the interview panel, and re-init the verbs for the stat panel
// Add verb for re-opening the interview panel, fixing chat and re-init the verbs for the stat panel
add_verb(src, /mob/dead/new_player/proc/open_interview)
add_verb(client, /client/verb/fix_tgui_panel)