diff --git a/code/controllers/subsystems/job.dm b/code/controllers/subsystems/job.dm index 87164044c27..c5e950a9145 100644 --- a/code/controllers/subsystems/job.dm +++ b/code/controllers/subsystems/job.dm @@ -176,20 +176,19 @@ var/min_job_age = job.get_minimum_character_age(V.get_species()) var/ideal_job_age = job.get_ideal_character_age(V.get_species()) - switch(age) - if(min_job_age to (min_job_age+10)) - weightedCandidates[V] = 3 // Still a bit young. - if((min_job_age+10) to (ideal_job_age-10)) - weightedCandidates[V] = 6 // Better. - if((ideal_job_age-10) to (ideal_job_age+10)) - weightedCandidates[V] = 10 // Great. - if((ideal_job_age+10) to (ideal_job_age+20)) - weightedCandidates[V] = 6 // Still good. - if((ideal_job_age+20) to INFINITY) - weightedCandidates[V] = 3 // Geezer. - else - // If there's ABSOLUTELY NOBODY ELSE - if(candidates.len == 1) weightedCandidates[V] = 1 + if(age > (ideal_job_age + 20)) // Elderly for the position + weightedCandidates[V] = 3 + else if(age > (ideal_job_age + 10)) // Good, but on the elderly side + weightedCandidates[V] = 6 + else if(age > (ideal_job_age - 10)) // Perfect + weightedCandidates[V] = 10 + else if(age > (min_job_age + 10)) // Good, but on the young side + weightedCandidates[V] = 6 + else if(age >= min_job_age) // Too young + weightedCandidates[V] = 3 + else + if(candidates.len == 1) // There's only one option + weightedCandidates[V] = 1 var/mob/abstract/new_player/candidate = pickweight(weightedCandidates) if(AssignRole(candidate, command_position)) diff --git a/code/game/objects/structures/bedsheet_bin.dm b/code/game/objects/structures/bedsheet_bin.dm index fc8c31069bc..ffe9547fbc9 100644 --- a/code/game/objects/structures/bedsheet_bin.dm +++ b/code/game/objects/structures/bedsheet_bin.dm @@ -389,11 +389,13 @@ LINEN BINS /obj/structure/bedsheetbin/update_icon() - switch(amount) - if(0) icon_state = "linenbin-empty" - if(1 to amount / 2) icon_state = "linenbin-half" - else icon_state = "linenbin-full" - + var/max_sheets = initial(amount) + if(amount > (max_sheets/2)) + icon_state = "linenbin-full" + else if(amount > 0) + icon_state = "linenbin-half" + else + icon_state = "linenbin-empty" /obj/structure/bedsheetbin/attackby(obj/item/I as obj, mob/user as mob) if(istype(I, /obj/item/bedsheet)) diff --git a/code/modules/mob/living/silicon/robot/life.dm b/code/modules/mob/living/silicon/robot/life.dm index 674049500cc..fb8779c9db6 100644 --- a/code/modules/mob/living/silicon/robot/life.dm +++ b/code/modules/mob/living/silicon/robot/life.dm @@ -196,21 +196,20 @@ else healths.icon_state = "health6" else - switch(health) - if(200 to INFINITY) - healths.icon_state = "health0" - if(150 to 200) - healths.icon_state = "health1" - if(100 to 150) - healths.icon_state = "health2" - if(50 to 100) - healths.icon_state = "health3" - if(0 to 50) - healths.icon_state = "health4" - if(config.health_threshold_dead to 0) - healths.icon_state = "health5" - else - healths.icon_state = "health6" + if(health >= 200) + healths.icon_state = "health0" + else if(health >= 150) + healths.icon_state = "health1" + else if(health >= 100) + healths.icon_state = "health2" + else if(health >= 50) + healths.icon_state = "health3" + else if(health >= 0) + healths.icon_state = "health4" + else if(health >= config.health_threshold_dead) + healths.icon_state = "health5" + else + healths.icon_state = "health6" else healths.icon_state = "health7" diff --git a/html/changelogs/johnwildkins-1602fix.yml b/html/changelogs/johnwildkins-1602fix.yml new file mode 100644 index 00000000000..b0767602852 --- /dev/null +++ b/html/changelogs/johnwildkins-1602fix.yml @@ -0,0 +1,4 @@ +author: JohnWildkins +delete-after: True +changes: + - bugfix: "Removed switch statements that used non-constant values in range checks for 515 compatibility."