diff --git a/code/modules/jobs/job_types/security_officer.dm b/code/modules/jobs/job_types/security_officer.dm index 03a8a79891c..18f59a6b9ba 100644 --- a/code/modules/jobs/job_types/security_officer.dm +++ b/code/modules/jobs/job_types/security_officer.dm @@ -320,7 +320,7 @@ GLOBAL_LIST_EMPTY(security_officer_distribution) * This is the function that is responsible for taking the list of preferences, * and spitting out what to put them in. * - * However, it should, wherever possible, prevent solo departments. + * However, it should, wherever possible, prevent solo departments. // BUBBER EDIT: This was patched out, allowing solo departments * That means that if there's one medical officer, and one engineering officer, * that they should be put onto the same department (either medical or engineering). * @@ -463,6 +463,8 @@ GLOBAL_LIST_EMPTY(security_officer_distribution) return selection /proc/get_distribution(candidates, departments) + // BUBBER EDIT BEGIN - REMOVES THE PAIRING CODE. + /* var/number_of_twos = min(departments, round(candidates / 2)) var/redistribute = candidates - (2 * number_of_twos) @@ -471,10 +473,18 @@ GLOBAL_LIST_EMPTY(security_officer_distribution) for (var/index in 1 to number_of_twos) distribution[index] = 2 + */ + var/distribution_size = min(departments, candidates) + var/redistribute = candidates - distribution_size + var/distribution[max(1, distribution_size)] + for (var/index in 1 to distribution_size) + distribution[index] = 1 + for (var/index in 0 to redistribute - 1) distribution[(index % departments) + 1] += 1 return distribution + // BUBBER EDIT END /proc/get_new_officer_distribution_from_late_join( preference, @@ -516,9 +526,13 @@ GLOBAL_LIST_EMPTY(security_officer_distribution) for (var/department in amount_in_departments) var/amount = amount_in_departments[department] + // BUBBER EDIT BEGIN - REMOVES THE PAIRING CODE. + /* if (amount == 1) return department - else if (lowest_amount > amount) + else*/ + if (lowest_amount > amount) + // BUBBER EDIT END lowest_departments = list(department) lowest_amount = amount else if (lowest_amount == amount) diff --git a/code/modules/unit_tests/security_officer_distribution.dm b/code/modules/unit_tests/security_officer_distribution.dm index 05d62eeab35..f6f57474055 100644 --- a/code/modules/unit_tests/security_officer_distribution.dm +++ b/code/modules/unit_tests/security_officer_distribution.dm @@ -6,6 +6,8 @@ "d" = SEC_DEPT_SUPPLY, \ )) +// BUBBER EDIT BEGIN REMOVAL - We don't distribute in a special pairing system +/* /// Test that security officers with specific distributions get their departments. /datum/unit_test/security_officer_roundstart_distribution @@ -106,6 +108,6 @@ test("a", list("a", "a", "b"), "b") test("a", list("a", "a", "b", "b"), "c") test("a", list("a", "a", "b", "b", "c", "c", "d", "d"), "a") - +*/ #undef SECURITY_OFFICER_DEPARTMENTS #undef SECURITY_OFFICER_DEPARTMENTS_TO_NAMES