From a999863e5c8b00185f91cdcd05aa77c787f3a14e Mon Sep 17 00:00:00 2001 From: CitadelStationBot Date: Sat, 10 Mar 2018 07:17:52 -0600 Subject: [PATCH] [MIRROR] Fixes mirror var desync (#5883) * Fixes mirror var desync (#36251) * Fixes mirror var desync --- .../LavaRuins/lavaland_surface_envy.dmm | 5 +++-- _maps/RandomZLevels/moonoutpost19.dmm | 4 +--- _maps/map_files/BoxStation/BoxStation.dmm | 8 +++----- code/game/objects/structures/mirror.dm | 14 ++++++++++---- 4 files changed, 17 insertions(+), 14 deletions(-) diff --git a/_maps/RandomRuins/LavaRuins/lavaland_surface_envy.dmm b/_maps/RandomRuins/LavaRuins/lavaland_surface_envy.dmm index 62485f8581..df9620cb67 100644 --- a/_maps/RandomRuins/LavaRuins/lavaland_surface_envy.dmm +++ b/_maps/RandomRuins/LavaRuins/lavaland_surface_envy.dmm @@ -24,7 +24,7 @@ /area/ruin/unpowered) "f" = ( /obj/structure/mirror{ - desc = "Oh no, seven years of bad luck!"; + desc = "This mirror has been shattered. It looks like the bad luck energies spilling from it are taking immediate effect on your surroundings!"; icon_state = "mirror_broke"; pixel_x = 28; broken = 1 @@ -56,6 +56,7 @@ /area/ruin/unpowered) "k" = ( /obj/structure/mirror{ + desc = "This mirror has been shattered. It looks like the bad luck energies spilling from it are taking immediate effect on your surroundings!"; icon_state = "mirror_broke"; pixel_y = 28; broken = 1 @@ -65,7 +66,7 @@ /area/ruin/unpowered) "l" = ( /obj/structure/mirror{ - desc = "Oh no, seven years of bad luck!"; + desc = "This mirror has been shattered. It looks like the bad luck energies spilling from it are taking immediate effect on your surroundings!"; icon_state = "mirror_broke"; pixel_x = 28; broken = 1 diff --git a/_maps/RandomZLevels/moonoutpost19.dmm b/_maps/RandomZLevels/moonoutpost19.dmm index cd7ef8de04..0e451edcfb 100644 --- a/_maps/RandomZLevels/moonoutpost19.dmm +++ b/_maps/RandomZLevels/moonoutpost19.dmm @@ -4078,10 +4078,8 @@ pixel_x = 11 }, /obj/structure/mirror{ - desc = "Oh no, seven years of bad luck!"; icon_state = "mirror_broke"; - pixel_x = 28; - broken = 1 + pixel_x = 28 }, /turf/open/floor/plasteel/freezer{ heat_capacity = 1e+006 diff --git a/_maps/map_files/BoxStation/BoxStation.dmm b/_maps/map_files/BoxStation/BoxStation.dmm index a23b4ac9d4..d96bcc6060 100644 --- a/_maps/map_files/BoxStation/BoxStation.dmm +++ b/_maps/map_files/BoxStation/BoxStation.dmm @@ -8216,8 +8216,7 @@ "auX" = ( /obj/structure/mirror{ icon_state = "mirror_broke"; - pixel_y = 28; - broken = 1 + pixel_y = 28 }, /obj/machinery/iv_drip, /turf/open/floor/plating, @@ -8225,8 +8224,7 @@ "auY" = ( /obj/structure/mirror{ icon_state = "mirror_broke"; - pixel_y = 28; - broken = 1 + pixel_y = 28 }, /obj/item/shard{ icon_state = "medium" @@ -33249,7 +33247,7 @@ department = "Medbay"; departmentType = 1; name = "Medbay RC"; - pixel_w = 30 + pixel_x = 30 }, /turf/open/floor/plasteel/white, /area/medical/sleeper) diff --git a/code/game/objects/structures/mirror.dm b/code/game/objects/structures/mirror.dm index 6553f5ec66..65b6e97a70 100644 --- a/code/game/objects/structures/mirror.dm +++ b/code/game/objects/structures/mirror.dm @@ -9,6 +9,10 @@ max_integrity = 200 integrity_failure = 100 +/obj/structure/mirror/Initialize(mapload) + . = ..() + if(icon_state == "mirror_broke" && !broken) + obj_break(null, mapload) /obj/structure/mirror/attack_hand(mob/user) if(broken || !Adjacent(user)) @@ -46,12 +50,14 @@ return // no message spam ..() -/obj/structure/mirror/obj_break(damage_flag) +/obj/structure/mirror/obj_break(damage_flag, mapload) if(!broken && !(flags_1 & NODECONSTRUCT_1)) icon_state = "mirror_broke" - playsound(src, "shatter", 70, 1) - desc = "Oh no, seven years of bad luck!" - broken = 1 + if(!mapload) + playsound(src, "shatter", 70, 1) + if(desc == initial(desc)) + desc = "Oh no, seven years of bad luck!" + broken = TRUE /obj/structure/mirror/deconstruct(disassembled = TRUE) if(!(flags_1 & NODECONSTRUCT_1))