Merge pull request #8809 from Ghommie/Ghommie-cit103

Quickfixing latejoin ghost roles, I'm sorry.
This commit is contained in:
kevinz000
2019-07-03 09:52:14 -07:00
committed by GitHub
2 changed files with 16 additions and 11 deletions
+5 -4
View File
@@ -71,13 +71,14 @@
/obj/effect/mob_spawn/Destroy()
GLOB.poi_list -= src
LAZYREMOVE(GLOB.mob_spawners[job_description ? job_description : name], src)
if(!LAZYLEN(GLOB.mob_spawners[job_description ? job_description : name]))
GLOB.mob_spawners -= job_description ? job_description : name
var/job_name = job_description ? job_description : name
GLOB.mob_spawners -= job_name
if(!LAZYLEN(GLOB.mob_spawners[job_name]))
LAZYREMOVE(GLOB.mob_spawners[job_name], src)
return ..()
/obj/effect/mob_spawn/proc/can_latejoin() //If it can be taken from the lobby.
return TRUE
return ghost_usable
/obj/effect/mob_spawn/proc/special(mob/M)
return
+11 -7
View File
@@ -443,10 +443,12 @@
for(var/datum/job/job in SSjob.occupations)
if(job && IsJobUnavailable(job.title, TRUE) == JOB_AVAILABLE)
available_job_count++
for(var/obj/effect/mob_spawn/spawner in GLOB.mob_spawners)
if(spawner.can_latejoin())
available_job_count++
break
for(var/spawner in GLOB.mob_spawners)
var/obj/effect/mob_spawn/S = pick(GLOB.mob_spawners[spawner])
if(!istype(S) || !S.can_latejoin())
continue
available_job_count++
break
if(!available_job_count)
dat += "<div class='notice red'>There are currently no open positions!</div>"
@@ -465,9 +467,11 @@
"Science" = list(jobs = list(), titles = GLOB.science_positions, color = "#e6b3e6"),
"Security" = list(jobs = list(), titles = GLOB.security_positions, color = "#ff9999"),
)
for(var/obj/effect/mob_spawn/spawner in GLOB.mob_spawners)
if(spawner.can_latejoin())
categorizedJobs["Ghost Role"]["jobs"] += spawner
for(var/spawner in GLOB.mob_spawners)
var/obj/effect/mob_spawn/S = pick(GLOB.mob_spawners[spawner])
if(!istype(S) || !S.can_latejoin())
continue
categorizedJobs["Ghost Role"]["jobs"] += S
for(var/datum/job/job in SSjob.occupations)
if(job && IsJobUnavailable(job.title, TRUE) == JOB_AVAILABLE)