mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
Refactor spawn_checks_vr and when it is called
This commit is contained in:
@@ -404,6 +404,7 @@ var/global/datum/controller/subsystem/ticker/ticker
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
// Ask their new_player mob to spawn them
|
// Ask their new_player mob to spawn them
|
||||||
|
if(!player.spawn_checks_vr(player.mind.assigned_role)) continue //VOREStation Add
|
||||||
var/mob/living/carbon/human/new_char = player.create_character()
|
var/mob/living/carbon/human/new_char = player.create_character()
|
||||||
|
|
||||||
// Created their playable character, delete their /mob/new_player
|
// Created their playable character, delete their /mob/new_player
|
||||||
|
|||||||
@@ -365,7 +365,7 @@
|
|||||||
if(!IsJobAvailable(rank))
|
if(!IsJobAvailable(rank))
|
||||||
alert(src,"[rank] is not available. Please try another.")
|
alert(src,"[rank] is not available. Please try another.")
|
||||||
return 0
|
return 0
|
||||||
if(!attempt_vr(src,"spawn_checks_vr",list())) return 0 // VOREStation Insert
|
if(!spawn_checks_vr(rank)) return 0 // VOREStation Insert
|
||||||
if(!client)
|
if(!client)
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
@@ -491,7 +491,6 @@
|
|||||||
|
|
||||||
|
|
||||||
/mob/new_player/proc/create_character(var/turf/T)
|
/mob/new_player/proc/create_character(var/turf/T)
|
||||||
if (!attempt_vr(src,"spawn_checks_vr",list())) return 0 // VOREStation Insert
|
|
||||||
spawning = 1
|
spawning = 1
|
||||||
close_spawn_windows()
|
close_spawn_windows()
|
||||||
|
|
||||||
|
|||||||
@@ -1,36 +1,41 @@
|
|||||||
/mob/new_player/proc/spawn_checks_vr()
|
/mob/new_player/proc/spawn_checks_vr(var/rank)
|
||||||
var/pass = TRUE
|
var/pass = TRUE
|
||||||
|
var/datum/job/J = SSjob.get_job(rank)
|
||||||
|
|
||||||
|
if(!J)
|
||||||
|
log_debug("Couldn't find job: [rank] for spawn_checks_vr, panic-returning that it's fine to spawn.")
|
||||||
|
return TRUE
|
||||||
|
|
||||||
//No Flavor Text
|
//No Flavor Text
|
||||||
if (config.require_flavor && client && client.prefs && client.prefs.flavor_texts && !client.prefs.flavor_texts["general"])
|
if (config.require_flavor && !client?.prefs?.flavor_texts["general"] && !(J.mob_type & JOB_SILICON))
|
||||||
to_chat(src,"<span class='warning'>Please set your general flavor text to give a basic description of your character. Set it using the 'Set Flavor text' button on the 'General' tab in character setup, and choosing 'General' category.</span>")
|
to_chat(src,"<span class='warning'>Please set your general flavor text to give a basic description of your character. Set it using the 'Set Flavor text' button on the 'General' tab in character setup, and choosing 'General' category.</span>")
|
||||||
pass = FALSE
|
pass = FALSE
|
||||||
|
|
||||||
//No OOC notes
|
//No OOC notes
|
||||||
if (config.allow_Metadata && client && client.prefs && (isnull(client.prefs.metadata) || length(client.prefs.metadata) < 15))
|
if (config.allow_Metadata && !(client?.prefs?.metadata || length(client.prefs.metadata) < 15))
|
||||||
to_chat(src,"<span class='warning'>Please set informative OOC notes related to ERP preferences. Set them using the 'OOC Notes' button on the 'General' tab in character setup.</span>")
|
to_chat(src,"<span class='warning'>Please set informative OOC notes related to ERP preferences. Set them using the 'OOC Notes' button on the 'General' tab in character setup.</span>")
|
||||||
pass = FALSE
|
pass = FALSE
|
||||||
|
|
||||||
//Are they on the VERBOTEN LIST?
|
//Are they on the VERBOTEN LIST?
|
||||||
if (prevent_respawns.Find(client.prefs.real_name))
|
if (prevent_respawns.Find(client?.prefs?.real_name))
|
||||||
to_chat(src,"<span class='warning'>You've already quit the round as this character. You can't go back now that you've free'd your job slot. Play another character, or wait for the next round.</span>")
|
to_chat(src,"<span class='warning'>You've already quit the round as this character. You can't go back now that you've free'd your job slot. Play another character, or wait for the next round.</span>")
|
||||||
pass = FALSE
|
pass = FALSE
|
||||||
|
|
||||||
//Do they have their scale properly setup?
|
//Do they have their scale properly setup?
|
||||||
if(!client.prefs.size_multiplier)
|
if(!client?.prefs?.size_multiplier)
|
||||||
pass = FALSE
|
pass = FALSE
|
||||||
to_chat(src,"<span class='warning'>You have not set your scale yet. Do this on the VORE tab in character setup.</span>")
|
to_chat(src,"<span class='warning'>You have not set your scale yet. Do this on the VORE tab in character setup.</span>")
|
||||||
|
|
||||||
//Can they play?
|
//Can they play?
|
||||||
if(!is_alien_whitelisted(src,GLOB.all_species[client.prefs.species]) && !check_rights(R_ADMIN, 0))
|
if(!is_alien_whitelisted(src,GLOB.all_species[client?.prefs?.species]) && !check_rights(R_ADMIN, 0))
|
||||||
pass = FALSE
|
pass = FALSE
|
||||||
to_chat(src,"<span class='warning'>You are not allowed to spawn in as this species.</span>")
|
to_chat(src,"<span class='warning'>You are not allowed to spawn in as this species.</span>")
|
||||||
|
|
||||||
//Custom species checks
|
//Custom species checks
|
||||||
if (client && client.prefs && client.prefs.species == "Custom Species")
|
if (client?.prefs?.species == "Custom Species")
|
||||||
|
|
||||||
//Didn't name it
|
//Didn't name it
|
||||||
if(!client.prefs.custom_species)
|
if(!client?.prefs?.custom_species)
|
||||||
pass = FALSE
|
pass = FALSE
|
||||||
to_chat(src,"<span class='warning'>You have to name your custom species. Do this on the VORE tab in character setup.</span>")
|
to_chat(src,"<span class='warning'>You have to name your custom species. Do this on the VORE tab in character setup.</span>")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user