Skip to content

Commit

Permalink
TGS Test Merge (#7911)
Browse files Browse the repository at this point in the history
  • Loading branch information
cm13-github committed Jan 21, 2025
2 parents 116192b + 7773754 commit bb2a35c
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions code/game/jobs/role_authority.dm
Original file line number Diff line number Diff line change
Expand Up @@ -545,32 +545,26 @@ I hope it's easier to tell what the heck this proc is even doing, unlike previou
for(var/datum/squad/squad in squads)
if(squad.roundstart && squad.usable && squad.faction == human.faction && squad.name != "Root")
mixed_squads += squad
mixed_squads = shuffle(mixed_squads)

var/preferred_squad
if(human?.client?.prefs?.preferred_squad)
preferred_squad = human.client.prefs.preferred_squad
var/preferred_squad = human.client?.prefs?.preferred_squad
if(preferred_squad == "None")
preferred_squad = null

var/datum/squad/lowest
for(var/datum/squad/squad in mixed_squads)
if(slot_check && !isnull(squad.roles_cap[slot_check]) && !skip_limit)
if(squad.roles_in[slot_check] >= squad.roles_cap[slot_check])
continue

if(squad.name == preferred_squad || squad.equivalent_name == preferred_squad) //fav squad or faction equivalent has a spot for us, no more searching needed.
if(preferred_squad && (squad.name == preferred_squad || squad.equivalent_name == preferred_squad)) //fav squad or faction equivalent has a spot for us, no more searching needed.
if(squad.put_marine_in_squad(human))
return

if(!lowest)
if(!lowest || (slot_check && lowest.roles_in[slot_check] > squad.roles_in[slot_check]))
lowest = squad

else if(slot_check)
if(squad.roles_in[slot_check] < lowest.roles_in[slot_check])
lowest = squad

if(!lowest || !lowest.put_marine_in_squad(human))
to_world("Warning! Bug in get_random_squad()!")
return
if(!lowest)
lowest = locate(/datum/squad/marine/cryo) in squads
lowest.put_marine_in_squad(human)
return

/datum/authority/branch/role/proc/get_caste_by_text(name)
Expand Down

0 comments on commit bb2a35c

Please sign in to comment.