From 810ca147d071992a61e5b3cc627ba8b1de7f1b38 Mon Sep 17 00:00:00 2001 From: mwerezak Date: Sat, 12 Sep 2015 19:34:43 -0400 Subject: [PATCH 1/5] Fixes #10710 --- code/modules/lighting/light_source.dm | 48 ++++++++++++++++----------- 1 file changed, 29 insertions(+), 19 deletions(-) diff --git a/code/modules/lighting/light_source.dm b/code/modules/lighting/light_source.dm index 2acddb4d298..3675cd945c3 100644 --- a/code/modules/lighting/light_source.dm +++ b/code/modules/lighting/light_source.dm @@ -1,3 +1,5 @@ +//So much copypasta in this file, supposedly in the name of performance. If you change anything make sure to consider other places where the code may have been copied. + /datum/light_source var/atom/top_atom var/atom/source_atom @@ -11,9 +13,10 @@ var/lum_g var/lum_b - var/tmp/old_lum_r - var/tmp/old_lum_g - var/tmp/old_lum_b + //hold onto the actual applied lum values so we can undo them when the lighting changes + var/tmp/applied_lum_r + var/tmp/applied_lum_g + var/tmp/applied_lum_b var/list/effect_str var/list/effect_turf @@ -107,11 +110,6 @@ if(light_range && light_power && !applied) . = 1 - if(. || source_atom.light_color != light_color)//Save the old lumcounts if we need to update, if the colour changed DO IT BEFORE we parse the colour and LOSE the old lumcounts! - old_lum_r = lum_r - old_lum_g = lum_g - old_lum_b = lum_b - if(source_atom.light_color != light_color) light_color = source_atom.light_color parse_light_color() @@ -149,6 +147,12 @@ /datum/light_source/proc/apply_lum() applied = 1 + + //Keep track of the last applied lum values so that the lighting can be reversed + applied_lum_r = lum_r + applied_lum_g = lum_g + applied_lum_b = lum_b + if(istype(source_turf)) FOR_DVIEW(var/turf/T, light_range, source_turf, INVISIBILITY_LIGHTING) if(T.lighting_overlay) @@ -164,9 +168,9 @@ effect_str += strength T.lighting_overlay.update_lumcount( - lum_r * strength, - lum_g * strength, - lum_b * strength + applied_lum_r * strength, + applied_lum_g * strength, + applied_lum_b * strength ) else @@ -188,7 +192,11 @@ if(T.lighting_overlay) var/str = effect_str[i] - T.lighting_overlay.update_lumcount(-str * old_lum_r, -str * old_lum_g, -str * old_lum_b) + T.lighting_overlay.update_lumcount( + -str * applied_lum_r, + -str * applied_lum_g, + -str * applied_lum_b + ) i++ @@ -218,9 +226,9 @@ effect_str += . T.lighting_overlay.update_lumcount( - lum_r * ., - lum_g * ., - lum_b * . + applied_lum_r * ., + applied_lum_g * ., + applied_lum_b * . ) else @@ -241,7 +249,7 @@ if(T.lighting_overlay) var/str = effect_str[idx] - T.lighting_overlay.update_lumcount(-str * lum_r, -str * lum_g, -str * lum_b) + T.lighting_overlay.update_lumcount(-str * applied_lum_r, -str * applied_lum_g, -str * applied_lum_b) effect_turf.Cut(idx, idx + 1) effect_str.Cut(idx, idx + 1) @@ -279,10 +287,12 @@ effect_str[idx] = . + //Since the applied_lum values are what are (later) removed by remove_lum. + //Anything we apply to the lighting overlays HAS to match what remove_lum uses. T.lighting_overlay.update_lumcount( - lum_r * ., - lum_g * ., - lum_b * . + applied_lum_r * ., + applied_lum_g * ., + applied_lum_b * . ) #undef LUM_FALLOFF From a938c7b64846f40c5c0e6e381424d6fcd1fefbbf Mon Sep 17 00:00:00 2001 From: PsiOmega Date: Sun, 13 Sep 2015 11:21:44 +0200 Subject: [PATCH 2/5] Prevents observer mice from spawning on the admin Z-level. --- code/modules/mob/dead/observer/observer.dm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 2b4a290e2bf..e58df4f1f93 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -422,6 +422,11 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp if(!MayRespawn(1)) return + var/turf/T = get_turf(src) + if(!T || (T.z in config.admin_levels)) + src << "You may not spawn as a mouse on this Z-level." + return + var/timedifference = world.time - client.time_died_as_mouse if(client.time_died_as_mouse && timedifference <= mouse_respawn_time * 600) var/timedifference_text @@ -437,8 +442,8 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp var/mob/living/simple_animal/mouse/host var/obj/machinery/atmospherics/unary/vent_pump/vent_found var/list/found_vents = list() - for(var/obj/machinery/atmospherics/unary/vent_pump/v in world) - if(!v.welded && v.z == src.z) + for(var/obj/machinery/atmospherics/unary/vent_pump/v in machines) + if(!v.welded && v.z == T.z) found_vents.Add(v) if(found_vents.len) vent_found = pick(found_vents) From eef1013db2fea16fda2e3d14550c3bf3d623314b Mon Sep 17 00:00:00 2001 From: Kelenius Date: Mon, 14 Sep 2015 16:54:24 +0300 Subject: [PATCH 3/5] Fixes #10925 Makes psilocybin less robust, also cuts down emote spam --- .../Chemistry-Reagents-Toxins.dm | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Toxins.dm b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Toxins.dm index fcf2f658a0a..7b604158a51 100644 --- a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Toxins.dm +++ b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Toxins.dm @@ -416,21 +416,21 @@ if(dose < 1) M.stuttering = max(M.stuttering, 3) M.make_dizzy(5) - if(prob(10)) + if(prob(5)) M.emote(pick("twitch", "giggle")) else if(dose < 2) M.stuttering = max(M.stuttering, 3) - M.make_jittery(10) - M.make_dizzy(10) + M.make_jittery(5) + M.make_dizzy(5) M.druggy = max(M.druggy, 35) - if(prob(20)) - M.emote(pick("twitch","giggle")) + if(prob(10)) + M.emote(pick("twitch", "giggle")) else M.stuttering = max(M.stuttering, 3) - M.make_jittery(20) - M.make_dizzy(20) + M.make_jittery(10) + M.make_dizzy(10) M.druggy = max(M.druggy, 40) - if(prob(30)) + if(prob(15)) M.emote(pick("twitch", "giggle")) /datum/reagent/nicotine From 4a9dc8dc8f9bd6ad9b49a7c53ad26df88742bd7f Mon Sep 17 00:00:00 2001 From: FalseIncarnate Date: Mon, 14 Sep 2015 17:35:33 -0400 Subject: [PATCH 4/5] Invisible / Missing Growth State Fix Fixes a number of plants seemingly randomly having invisible plant growth states. - This was caused by overly-rounded math resulting in attempts to call growth states that do not exist. --- code/modules/hydroponics/trays/tray_update_icons.dm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/code/modules/hydroponics/trays/tray_update_icons.dm b/code/modules/hydroponics/trays/tray_update_icons.dm index 7f31a06477b..dc69e5448ee 100644 --- a/code/modules/hydroponics/trays/tray_update_icons.dm +++ b/code/modules/hydroponics/trays/tray_update_icons.dm @@ -36,7 +36,9 @@ if(age >= seed.get_trait(TRAIT_MATURATION)) overlay_stage = seed.growth_stages else - var/maturation = round(seed.get_trait(TRAIT_MATURATION)/seed.growth_stages) + var/maturation = seed.get_trait(TRAIT_MATURATION)/seed.growth_stages + if(maturation < 1) + maturation = 1 overlay_stage = maturation ? max(1,round(age/maturation)) : 1 var/ikey = "[seed.get_trait(TRAIT_PLANT_ICON)]-[overlay_stage]" var/image/plant_overlay = plant_controller.plant_icon_cache["[ikey]-[seed.get_trait(TRAIT_PLANT_COLOUR)]"] From 52b51a6be47208cd80027e7ea5d4f23bc159b886 Mon Sep 17 00:00:00 2001 From: GinjaNinja32 Date: Tue, 15 Sep 2015 13:24:11 +0100 Subject: [PATCH 5/5] fix #11061 --- code/game/atoms.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/atoms.dm b/code/game/atoms.dm index 83a5657f1cf..2cf913f7a95 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -413,7 +413,7 @@ its easier to just keep the beam vertical. return src.germ_level = 0 if(istype(blood_DNA, /list)) - blood_DNA.Cut() + blood_DNA = null return 1