From 1b3246c1962d7b47d3e5258248fecb21bc9d4656 Mon Sep 17 00:00:00 2001 From: SkyMarshal Date: Tue, 13 Jan 2015 15:22:55 -0700 Subject: [PATCH 01/12] Adds a constant for the surface area of a HE pipe exposed to sunlight. --- code/setup.dm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/setup.dm b/code/setup.dm index 723766ea786..68842e7e088 100644 --- a/code/setup.dm +++ b/code/setup.dm @@ -11,8 +11,9 @@ //radiation constants #define STEFAN_BOLTZMANN_CONSTANT 0.0000000567 //W/(m^2*K^4) #define COSMIC_RADIATION_TEMPERATURE 3.15 //K -#define AVERAGE_SOLAR_RADIATION 200 //W/m^2. Kind of arbitrary. Really this should depend on the sun position much like solars. +#define AVERAGE_SOLAR_RADIATION 200 //W/m^2. Kind of arbitrary. Really this should depend on the sun position much like solars. From the numbers on Erebus, this'd be an orbit of 23.3 lightseconds. #define RADIATOR_OPTIMUM_PRESSURE 110 //kPa at 20 C +#define RADIATOR_EXPOSED_SURFACE_AREA 0.03 //The pipe looks to be thin vertically and wide horizontally, so we'll assume that it's three centimeters thick and only explosed to the sun edge-on. #define CELL_VOLUME 2500 //liters in a cell #define MOLES_CELLSTANDARD (ONE_ATMOSPHERE*CELL_VOLUME/(T20C*R_IDEAL_GAS_EQUATION)) //moles in a 2.5 m^3 cell at 101.325 Pa and 20 degC From 1ab66130ffe40eb1c617d9a90ce846473e443530 Mon Sep 17 00:00:00 2001 From: SkyMarshal Date: Tue, 13 Jan 2015 15:28:42 -0700 Subject: [PATCH 02/12] Changed heat exchange pipe properties. No more suns above and below station shining on every square centimeter of it. --- code/ATMOSPHERICS/datum_pipeline.dm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/code/ATMOSPHERICS/datum_pipeline.dm b/code/ATMOSPHERICS/datum_pipeline.dm index aa4473babd5..d2978e887a4 100644 --- a/code/ATMOSPHERICS/datum_pipeline.dm +++ b/code/ATMOSPHERICS/datum_pipeline.dm @@ -205,9 +205,13 @@ datum/pipeline var/gas_density = air.total_moles/air.volume thermal_conductivity *= min(gas_density / ( RADIATOR_OPTIMUM_PRESSURE/(R_IDEAL_GAS_EQUATION*T20C) ), 1) + // We only get heat from the star on the exposed surface area. + var/heat_gain = AVERAGE_SOLAR_RADIATION * RADIATOR_EXPOSED_SURFACE_AREA * thermal_conductivity + //if the h/e pipes radiate less than the AVERAGE_SOLAR_RADIATION, then they will heat up, otherwise they will cool down. It turns out the critical temperature is -26 C - var/heat_gain = surface*(AVERAGE_SOLAR_RADIATION - STEFAN_BOLTZMANN_CONSTANT*thermal_conductivity*(air.temperature - COSMIC_RADIATION_TEMPERATURE) ** 4) + // Only would happen if both sides (all 2 square meters of surface area) were exposed to sunlight. We now assume it aligned edge on. + heat_gain += surface * STEFAN_BOLTZMANN_CONSTANT * thermal_conductivity * (air.temperature - COSMIC_RADIATION_TEMPERATURE) ** 4 air.add_thermal_energy(heat_gain) if(network) - network.update = 1 \ No newline at end of file + network.update = 1 From 82b5bd0f5223f9425bbbeb814d05ba55822aebb9 Mon Sep 17 00:00:00 2001 From: SkyMarshal Date: Tue, 13 Jan 2015 15:32:03 -0700 Subject: [PATCH 03/12] Sign errors are almost as bad as off-by-one. --- code/ATMOSPHERICS/datum_pipeline.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/ATMOSPHERICS/datum_pipeline.dm b/code/ATMOSPHERICS/datum_pipeline.dm index d2978e887a4..d72b8b2dbf7 100644 --- a/code/ATMOSPHERICS/datum_pipeline.dm +++ b/code/ATMOSPHERICS/datum_pipeline.dm @@ -210,7 +210,7 @@ datum/pipeline //if the h/e pipes radiate less than the AVERAGE_SOLAR_RADIATION, then they will heat up, otherwise they will cool down. It turns out the critical temperature is -26 C // Only would happen if both sides (all 2 square meters of surface area) were exposed to sunlight. We now assume it aligned edge on. - heat_gain += surface * STEFAN_BOLTZMANN_CONSTANT * thermal_conductivity * (air.temperature - COSMIC_RADIATION_TEMPERATURE) ** 4 + heat_gain -= surface * STEFAN_BOLTZMANN_CONSTANT * thermal_conductivity * (air.temperature - COSMIC_RADIATION_TEMPERATURE) ** 4 air.add_thermal_energy(heat_gain) if(network) From 5104e40be3b2256940c13d030eca5919bfe51de8 Mon Sep 17 00:00:00 2001 From: SkyMarshal Date: Tue, 13 Jan 2015 15:41:45 -0700 Subject: [PATCH 04/12] Adding calculated temperature for HE pipes. --- code/ATMOSPHERICS/datum_pipeline.dm | 1 + 1 file changed, 1 insertion(+) diff --git a/code/ATMOSPHERICS/datum_pipeline.dm b/code/ATMOSPHERICS/datum_pipeline.dm index d72b8b2dbf7..f663ccb34e5 100644 --- a/code/ATMOSPHERICS/datum_pipeline.dm +++ b/code/ATMOSPHERICS/datum_pipeline.dm @@ -210,6 +210,7 @@ datum/pipeline //if the h/e pipes radiate less than the AVERAGE_SOLAR_RADIATION, then they will heat up, otherwise they will cool down. It turns out the critical temperature is -26 C // Only would happen if both sides (all 2 square meters of surface area) were exposed to sunlight. We now assume it aligned edge on. + // It currently should stabilise at 85K or -183C. heat_gain -= surface * STEFAN_BOLTZMANN_CONSTANT * thermal_conductivity * (air.temperature - COSMIC_RADIATION_TEMPERATURE) ** 4 air.add_thermal_energy(heat_gain) From 12d056106ec0154e94815a187e240190b7bf8c02 Mon Sep 17 00:00:00 2001 From: SkyMarshal Date: Thu, 15 Jan 2015 17:57:52 -0700 Subject: [PATCH 05/12] Adjusts informative comments. --- code/ATMOSPHERICS/datum_pipeline.dm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/ATMOSPHERICS/datum_pipeline.dm b/code/ATMOSPHERICS/datum_pipeline.dm index f663ccb34e5..fd933bf94dc 100644 --- a/code/ATMOSPHERICS/datum_pipeline.dm +++ b/code/ATMOSPHERICS/datum_pipeline.dm @@ -206,9 +206,10 @@ datum/pipeline thermal_conductivity *= min(gas_density / ( RADIATOR_OPTIMUM_PRESSURE/(R_IDEAL_GAS_EQUATION*T20C) ), 1) // We only get heat from the star on the exposed surface area. + // If the HE pipes gain more energy from AVERAGE_SOLAR_RADIATION than they can radiate, then they have a net heat increase. var/heat_gain = AVERAGE_SOLAR_RADIATION * RADIATOR_EXPOSED_SURFACE_AREA * thermal_conductivity - //if the h/e pipes radiate less than the AVERAGE_SOLAR_RADIATION, then they will heat up, otherwise they will cool down. It turns out the critical temperature is -26 C + // Previously, the temperature would enter equilibrium at 26C or 294K. // Only would happen if both sides (all 2 square meters of surface area) were exposed to sunlight. We now assume it aligned edge on. // It currently should stabilise at 85K or -183C. heat_gain -= surface * STEFAN_BOLTZMANN_CONSTANT * thermal_conductivity * (air.temperature - COSMIC_RADIATION_TEMPERATURE) ** 4 From 00be76992292cfae62daf58abb5b5e6a8c5ea3f9 Mon Sep 17 00:00:00 2001 From: Loganbacca Date: Tue, 20 Jan 2015 22:55:41 +1300 Subject: [PATCH 06/12] Fixed AI status display not updating --- code/game/machinery/status_display_ai.dm | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/code/game/machinery/status_display_ai.dm b/code/game/machinery/status_display_ai.dm index 4077c6d56d7..ac9701908be 100644 --- a/code/game/machinery/status_display_ai.dm +++ b/code/game/machinery/status_display_ai.dm @@ -72,6 +72,12 @@ var/list/ai_status_emotions = list( var/emote = input("Please, select a status!", "AI Status", null, null) in ai_emotions src.emotion = emote +/obj/machinery/ai_status_display/process() + if(stat & NOPOWER) + remove_display() + return + update() + /obj/machinery/ai_status_display/proc/update() if(mode==0) //Blank overlays.Cut() @@ -91,3 +97,7 @@ var/list/ai_status_emotions = list( if(overlays.len) overlays.Cut() overlays += image('icons/obj/status_display.dmi', icon_state=picture_state) + +/obj/machinery/ai_status_display/proc/remove_display() + if(overlays.len) + overlays.Cut() \ No newline at end of file From b3e367c778d486f2875c77d7e4f13e112013c096 Mon Sep 17 00:00:00 2001 From: PsiOmega Date: Tue, 20 Jan 2015 11:22:58 +0100 Subject: [PATCH 07/12] Fixes #7879. Can now enable/disable turrets through a turret controller again. Adds missing checks to prevent abuse. --- code/game/machinery/portable_turret.dm | 7 ++++++- code/game/machinery/turret_control.dm | 13 ++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/code/game/machinery/portable_turret.dm b/code/game/machinery/portable_turret.dm index 603fc9fe989..7497edd695c 100644 --- a/code/game/machinery/portable_turret.dm +++ b/code/game/machinery/portable_turret.dm @@ -154,6 +154,12 @@ user << "There seems to be a firewall preventing you from accessing this device." return 0 + if (get_dist(src, user) > 0 && !issilicon(user)) + user << "You are too far away." + user.unset_machine() + user << browse(null, "window=turretid") + return 0 + if(locked && !issilicon(user)) user << "Access denied." return 0 @@ -175,7 +181,6 @@ Automatic Portable Turret Installation

Status: []
Behaviour controls are [locked ? "locked" : "unlocked"]"}, - "[on ? "On" : "Off"]" ) if(!locked || issilicon(user)) diff --git a/code/game/machinery/turret_control.dm b/code/game/machinery/turret_control.dm index ce2a3b73ad3..41a98103be3 100644 --- a/code/game/machinery/turret_control.dm +++ b/code/game/machinery/turret_control.dm @@ -66,15 +66,20 @@ return /obj/machinery/turretid/proc/can_use(mob/user) + if(ailock && issilicon(user)) + user << "There seems to be a firewall preventing you from accessing this device." + return 0 + if (get_dist(src, user) > 0 && !issilicon(user)) user << "You are too far away." user.unset_machine() user << browse(null, "window=turretid") return 0 - if(ailock && issilicon(user)) - user << "There seems to be a firewall preventing you from accessing this device." + if(locked && !issilicon(user)) + user << "Access denied." return 0 + return 1 /obj/machinery/turretid/attackby(obj/item/weapon/W, mob/user) @@ -124,7 +129,9 @@ if (!istype(loc, /area)) return var/area/area = loc - var/dat = "" + var/dat = text({"Status: []
+ Behaviour controls are [locked ? "locked" : "unlocked"]"}, + "[enabled ? "On" : "Off"]" ) if(!locked || issilicon(user)) dat += text({"

From 07cc7a156b547a3476112b402d942a105dd37e8a Mon Sep 17 00:00:00 2001 From: PsiOmega Date: Tue, 20 Jan 2015 11:34:29 +0100 Subject: [PATCH 08/12] Fixes #7857. Must now remain adjacent to the teleporter computer if you wish to change target location. --- code/game/machinery/teleporter.dm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/code/game/machinery/teleporter.dm b/code/game/machinery/teleporter.dm index b247f179195..f2d298ada76 100644 --- a/code/game/machinery/teleporter.dm +++ b/code/game/machinery/teleporter.dm @@ -122,6 +122,9 @@ L[tmpname] = I var/desc = input("Please select a location to lock in.", "Locking Computer") in L + if(get_dist(src, usr) > 1) + return + src.locked = L[desc] for(var/mob/O in hearers(src, null)) O.show_message("\blue Locked In", 2) From 5f5fc4b0a616a8f91e1340c5a17dd84a7820ed6b Mon Sep 17 00:00:00 2001 From: PsiOmega Date: Tue, 20 Jan 2015 13:32:59 +0100 Subject: [PATCH 09/12] Fixes #7880. Adds () around the "M.z in list" check, otherwise BYOND attempts to check "M.z in (list && hassensorlevel)". Also attempts to properly acquire the current Z position. --- code/game/machinery/camera/tracking.dm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/code/game/machinery/camera/tracking.dm b/code/game/machinery/camera/tracking.dm index f274a1d07ea..4e64b9a6606 100644 --- a/code/game/machinery/camera/tracking.dm +++ b/code/game/machinery/camera/tracking.dm @@ -236,7 +236,11 @@ return 1 /proc/trackable(var/mob/living/M) - return near_camera(M) || (M.loc.z in config.station_levels && hassensorlevel(M, SUIT_SENSOR_TRACKING)) + var/turf/T = get_turf(M) + if(T && (T.z in config.station_levels) && hassensorlevel(M, SUIT_SENSOR_TRACKING)) + return 1 + + return near_camera(M) /obj/machinery/camera/attack_ai(var/mob/living/silicon/ai/user as mob) if (!istype(user)) From 9452c11b56e362a776ce051a3a726438a7b52628 Mon Sep 17 00:00:00 2001 From: PsiOmega Date: Tue, 20 Jan 2015 20:40:35 +0100 Subject: [PATCH 10/12] Reduces the risk of unnecessary borg designation announcements. --- code/modules/mob/living/silicon/robot/robot.dm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index aeebc30bb3d..38873d02a82 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -1304,4 +1304,5 @@ var/list/robot_verbs_default = list( if(2) //New Module connected_ai << "

NOTICE - [braintype] module change detected: [name] has loaded the [module.name].
" if(3) //New Name - connected_ai << "

NOTICE - [braintype] reclassification detected: [oldname] is now designated as [newname].
" \ No newline at end of file + if(oldname != newname) + connected_ai << "

NOTICE - [braintype] reclassification detected: [oldname] is now designated as [newname].
" \ No newline at end of file From 8dbe6d2f35690fec42923853b5ffbd1c2b70e70c Mon Sep 17 00:00:00 2001 From: Atlantiscze Date: Tue, 20 Jan 2015 21:12:52 +0100 Subject: [PATCH 11/12] Fixes two powernet related issues: - First issue is power monitoring consoles showing slightly inaccurate values. The code calculated some sort of level average which resulted in stupid values being reported (like load 500kW available 300kW). This also fixes APC load partially showing as Other load on the console. - Second fixed issue (Fixes #7869) resolved gamebreaking bug that caused total irreversible failure of all powernets if makepowernets() was called. This, for example, includes large enough explosions, via admin command, or few other cases. --- code/modules/power/powernet.dm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/code/modules/power/powernet.dm b/code/modules/power/powernet.dm index 401cb41af77..791b69e9498 100644 --- a/code/modules/power/powernet.dm +++ b/code/modules/power/powernet.dm @@ -16,9 +16,11 @@ /datum/powernet/New() powernets += src + ..() /datum/powernet/Del() powernets -= src + ..() //Returns the amount of excess power (before refunding to SMESs) from last tick. //This is for machines that might adjust their power consumption using this data. @@ -110,8 +112,7 @@ S.restore() // and restore some of the power that was used //updates the viewed load (as seen on power computers) - viewload = 0.8*viewload + 0.2*load - viewload = round(viewload) + viewload = round(load) //reset the powernet load = 0 From 3b7a3fba7a7d3a5058ba26d2d39acd866b5a6fd4 Mon Sep 17 00:00:00 2001 From: Loganbacca Date: Wed, 21 Jan 2015 12:37:20 +1300 Subject: [PATCH 12/12] Removed process() dependency --- code/game/machinery/status_display_ai.dm | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/code/game/machinery/status_display_ai.dm b/code/game/machinery/status_display_ai.dm index ac9701908be..0b7371c1b08 100644 --- a/code/game/machinery/status_display_ai.dm +++ b/code/game/machinery/status_display_ai.dm @@ -43,6 +43,7 @@ var/list/ai_status_emotions = list( if(istype(M, /obj/machinery/ai_status_display)) var/obj/machinery/ai_status_display/AISD = M AISD.emotion = emote + AISD.update() //if Friend Computer, change ALL displays else if(istype(M, /obj/machinery/status_display)) @@ -73,10 +74,7 @@ var/list/ai_status_emotions = list( src.emotion = emote /obj/machinery/ai_status_display/process() - if(stat & NOPOWER) - remove_display() - return - update() + return /obj/machinery/ai_status_display/proc/update() if(mode==0) //Blank @@ -98,6 +96,10 @@ var/list/ai_status_emotions = list( overlays.Cut() overlays += image('icons/obj/status_display.dmi', icon_state=picture_state) -/obj/machinery/ai_status_display/proc/remove_display() - if(overlays.len) - overlays.Cut() \ No newline at end of file +/obj/machinery/ai_status_display/power_change() + ..() + if(stat & NOPOWER) + if(overlays.len) + overlays.Cut() + else + update()