diff --git a/code/game/machinery/barsigns.dm b/code/game/machinery/barsigns.dm index 6a30959360f..7a193a68762 100644 --- a/code/game/machinery/barsigns.dm +++ b/code/game/machinery/barsigns.dm @@ -37,7 +37,7 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/barsign, 32) update_appearance() /obj/machinery/barsign/update_icon_state() - if(!(machine_stat & (NOPOWER|BROKEN)) && chosen_sign && chosen_sign.icon_state) + if(!(machine_stat & BROKEN) && (!(machine_stat & NOPOWER) || machine_stat & EMPED) && chosen_sign && chosen_sign.icon_state) icon_state = chosen_sign.icon_state else icon_state = "empty" @@ -60,7 +60,7 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/barsign, 32) /obj/machinery/barsign/update_overlays() . = ..() - if(machine_stat & (NOPOWER|BROKEN)) + if(((machine_stat & NOPOWER) && !(machine_stat & EMPED)) || (machine_stat & BROKEN)) return if(chosen_sign && chosen_sign.light_mask) diff --git a/code/modules/unit_tests/barsigns.dm b/code/modules/unit_tests/barsigns.dm index ecef46fa3f0..0914522446f 100644 --- a/code/modules/unit_tests/barsigns.dm +++ b/code/modules/unit_tests/barsigns.dm @@ -47,3 +47,24 @@ TEST_FAIL("[sign_type] does not have a unique name.") existing_names += sign.name + +/** + * Test that an emped barsign displays correctly + */ +/datum/unit_test/barsigns_emp + +/datum/unit_test/barsigns_emp/Run() + var/obj/machinery/barsign/testing_sign = allocate(/obj/machinery/barsign) + var/datum/barsign/hiddensigns/empbarsign/emp_bar_sign = /datum/barsign/hiddensigns/empbarsign + + testing_sign.emp_act(EMP_HEAVY) + + // make sure we get the correct chosen_sign set + if(!istype(testing_sign.chosen_sign, emp_bar_sign)) + TEST_FAIL("[testing_sign] got EMPed but did not get its chosen_sign set correctly.") + + // make sure the sign's icon_state actually got set + var/expected_icon_state = initial(emp_bar_sign.icon_state) + if(testing_sign.icon_state != expected_icon_state) + TEST_FAIL("[testing_sign]'s icon_state was [testing_sign.icon_state] when it should have been [expected_icon_state].") + diff --git a/icons/obj/machines/barsigns.dmi b/icons/obj/machines/barsigns.dmi index 56b1b8232bf..6df58d57aae 100644 Binary files a/icons/obj/machines/barsigns.dmi and b/icons/obj/machines/barsigns.dmi differ