Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix latejoin cyborgs sometimes ending up in walls and such #4989

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions code/modules/jobs/job_types/cyborg.dm
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,14 @@

/datum/job/cyborg/proc/get_random_open_turf_in_area()
var/list/turfs = get_area_turfs(/area/station/ai_monitored/turret_protected/ai_upload)
var/turf/open/target_turf = null
while(!target_turf)
var/turf/turf = pick(turfs)
if(!turf.density)
target_turf = turf
return target_turf
while(length(turfs))
var/turf/turf = pick_n_take(turfs)
if(!isfloorturf(turf) || turf.is_blocked_turf(exclude_mobs = TRUE))
continue
return turf
stack_trace("Failed to find eligible spawn turf for a cyborg, using observer start landmark instead.")
var/obj/effect/landmark/observer_start/target = locate(/obj/effect/landmark/observer_start) in GLOB.landmarks_list
return get_turf(target)

/datum/job/cyborg/after_spawn(mob/living/spawned, client/player_client)
. = ..()
Expand Down
Loading