Skip to content

Commit

Permalink
Requested refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
Drulikar committed Jul 5, 2023
1 parent a05a0bc commit 4cc92eb
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions code/modules/mob/living/carbon/xenomorph/Embryo.dm
Original file line number Diff line number Diff line change
Expand Up @@ -149,16 +149,17 @@
var/mob/picked
// If the bursted person themselves has Xeno enabled, they get the honor of first dibs on the new larva.
if((!isyautja(affected_mob) || (isyautja(affected_mob) && prob(20))) && istype(affected_mob.buckled, /obj/structure/bed/nest))
if(affected_mob.first_xeno || (affected_mob.client && affected_mob.client.prefs && (affected_mob.client.prefs.be_special & BE_ALIEN_AFTER_DEATH) && !jobban_isbanned(affected_mob, JOB_XENOMORPH)))
if(affected_mob.first_xeno || (affected_mob.client?.prefs?.be_special & BE_ALIEN_AFTER_DEATH && !jobban_isbanned(affected_mob, JOB_XENOMORPH)))
picked = affected_mob
else if(affected_mob.mind && affected_mob.mind.ghost_mob && affected_mob.client && affected_mob.client.prefs && (affected_mob.client.prefs.be_special & BE_ALIEN_AFTER_DEATH) && !jobban_isbanned(affected_mob, JOB_XENOMORPH))
else if(affected_mob.mind?.ghost_mob && affected_mob.client?.prefs?.be_special & BE_ALIEN_AFTER_DEATH && !jobban_isbanned(affected_mob, JOB_XENOMORPH))
picked = affected_mob.mind.ghost_mob // This currently doesn't look possible
else if(affected_mob.persistent_ckey)
for(var/mob/dead/observer/cur_obs as anything in GLOB.observer_list)
if(cur_obs.ckey == affected_mob.persistent_ckey)
if(cur_obs.client && cur_obs.client.prefs && (cur_obs.client.prefs.be_special & BE_ALIEN_AFTER_DEATH) && !jobban_isbanned(cur_obs, JOB_XENOMORPH))
picked = cur_obs
break
if(cur_obs.ckey != affected_mob.persistent_ckey)
continue
if(cur_obs?.client?.prefs?.be_special & BE_ALIEN_AFTER_DEATH && !jobban_isbanned(cur_obs, JOB_XENOMORPH))
picked = cur_obs
break

if(!picked)
// Get a candidate from observers
Expand Down

0 comments on commit 4cc92eb

Please sign in to comment.