mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
Merge pull request #5062 from VOREStation/vs-port-3122
[PORT] Fix oversight in not-late-join jobs without spawnpoints on the map.
This commit is contained in:
@@ -327,6 +327,27 @@ var/global/datum/controller/occupations/job_master
|
||||
var/datum/job/job = GetJob(rank)
|
||||
var/list/spawn_in_storage = list()
|
||||
|
||||
if(!joined_late)
|
||||
var/obj/S = null
|
||||
for(var/obj/effect/landmark/start/sloc in landmarks_list)
|
||||
if(sloc.name != rank) continue
|
||||
if(locate(/mob/living) in sloc.loc) continue
|
||||
S = sloc
|
||||
break
|
||||
if(!S)
|
||||
S = locate("start*[rank]") // use old stype
|
||||
if(istype(S, /obj/effect/landmark/start) && istype(S.loc, /turf))
|
||||
H.forceMove(S.loc)
|
||||
else
|
||||
var/list/spawn_props = LateSpawn(H.client, rank)
|
||||
var/turf/T = spawn_props["turf"]
|
||||
H.forceMove(T)
|
||||
|
||||
// Moving wheelchair if they have one
|
||||
if(H.buckled && istype(H.buckled, /obj/structure/bed/chair/wheelchair))
|
||||
H.buckled.forceMove(H.loc)
|
||||
H.buckled.set_dir(H.dir)
|
||||
|
||||
if(job)
|
||||
|
||||
//Equip custom gear loadout.
|
||||
@@ -398,25 +419,6 @@ var/global/datum/controller/occupations/job_master
|
||||
|
||||
H.job = rank
|
||||
|
||||
if(!joined_late)
|
||||
var/obj/S = null
|
||||
for(var/obj/effect/landmark/start/sloc in landmarks_list)
|
||||
if(sloc.name != rank) continue
|
||||
if(locate(/mob/living) in sloc.loc) continue
|
||||
S = sloc
|
||||
break
|
||||
if(!S)
|
||||
S = locate("start*[rank]") // use old stype
|
||||
if(istype(S, /obj/effect/landmark/start) && istype(S.loc, /turf))
|
||||
H.forceMove(S.loc)
|
||||
else
|
||||
LateSpawn(H, rank)
|
||||
|
||||
// Moving wheelchair if they have one
|
||||
if(H.buckled && istype(H.buckled, /obj/structure/bed/chair/wheelchair))
|
||||
H.buckled.forceMove(H.loc)
|
||||
H.buckled.set_dir(H.dir)
|
||||
|
||||
// If they're head, give them the account info for their department
|
||||
if(H.mind && job.head_position)
|
||||
var/remembered_info = ""
|
||||
@@ -612,7 +614,7 @@ var/global/datum/controller/occupations/job_master
|
||||
var/datum/spawnpoint/spawnpos
|
||||
|
||||
//Spawn them at their preferred one
|
||||
if(C.prefs.spawnpoint)
|
||||
if(C && C.prefs.spawnpoint)
|
||||
if(!(C.prefs.spawnpoint in using_map.allowed_spawns))
|
||||
to_chat(C, "<span class='warning'>Your chosen spawnpoint ([C.prefs.spawnpoint]) is unavailable for the current map. Spawning you at one of the enabled spawn points instead.</span>")
|
||||
spawnpos = null
|
||||
|
||||
Reference in New Issue
Block a user