From fe4490a295f17c922a1e16aa8f4627c87526203f Mon Sep 17 00:00:00 2001 From: Mloc Date: Sun, 26 Jul 2015 20:53:13 +0100 Subject: [PATCH 1/5] fixes #10316 Signed-off-by: Mloc --- code/game/objects/items/weapons/tools.dm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/code/game/objects/items/weapons/tools.dm b/code/game/objects/items/weapons/tools.dm index 5f83f32581..aa2a8734a6 100644 --- a/code/game/objects/items/weapons/tools.dm +++ b/code/game/objects/items/weapons/tools.dm @@ -211,8 +211,12 @@ /obj/item/weapon/weldingtool/process() - if(welding && prob(5) && !remove_fuel(1)) - setWelding(0) + if(welding) + if(prob(5)) + remove_fuel(1) + + if(get_fuel() == 0) + setWelding(0) //I'm not sure what this does. I assume it has to do with starting fires... //...but it doesnt check to see if the welder is on or not. From 1d8e015334db1077a1607af9f4e88d51c6adcdd8 Mon Sep 17 00:00:00 2001 From: Mloc Date: Mon, 27 Jul 2015 10:49:51 +0100 Subject: [PATCH 2/5] fixes #10141 also clean up alloy_data handling Signed-off-by: Mloc --- code/modules/mining/alloys.dm | 4 ++-- code/modules/mining/machine_processing.dm | 11 ++++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/code/modules/mining/alloys.dm b/code/modules/mining/alloys.dm index 9461c1e6b9..dac05badd0 100644 --- a/code/modules/mining/alloys.dm +++ b/code/modules/mining/alloys.dm @@ -12,7 +12,7 @@ metaltag = "plasteel" requires = list( "platinum" = 1, - "coal" = 2, + "carbon" = 2, "hematite" = 2 ) product_mod = 0.3 @@ -21,7 +21,7 @@ /datum/alloy/steel metaltag = DEFAULT_WALL_MATERIAL requires = list( - "coal" = 1, + "carbon" = 1, "hematite" = 1 ) product = /obj/item/stack/material/steel \ No newline at end of file diff --git a/code/modules/mining/machine_processing.dm b/code/modules/mining/machine_processing.dm index 649dee1e1e..0eb8bdaa1f 100644 --- a/code/modules/mining/machine_processing.dm +++ b/code/modules/mining/machine_processing.dm @@ -112,16 +112,17 @@ var/sheets_per_tick = 10 var/list/ores_processing[0] var/list/ores_stored[0] - var/list/alloy_data[0] + var/static/list/alloy_data var/active = 0 /obj/machinery/mineral/processing_unit/New() - ..() - //TODO: Ore and alloy global storage datum. - for(var/alloytype in typesof(/datum/alloy)-/datum/alloy) - alloy_data += new alloytype() + // initialize static alloy_data list + if(!alloy_data) + alloy_data = list() + for(var/alloytype in typesof(/datum/alloy)-/datum/alloy) + alloy_data += new alloytype() if(!ore_data || !ore_data.len) for(var/oretype in typesof(/ore)-/ore) From aab326e05f3089783d4c287de571933499c6fcfe Mon Sep 17 00:00:00 2001 From: Mloc Date: Mon, 27 Jul 2015 11:40:37 +0100 Subject: [PATCH 3/5] fixes #10232 makes lights trigger on forceMove using a vg change Signed-off-by: Mloc --- code/modules/lighting/lighting_atom.dm | 14 +++----------- code/modules/lighting/lighting_overlay.dm | 2 ++ code/modules/lighting/lighting_turf.dm | 10 ++++++++++ 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/code/modules/lighting/lighting_atom.dm b/code/modules/lighting/lighting_atom.dm index 92500ecc1d..6968a4ed63 100644 --- a/code/modules/lighting/lighting_atom.dm +++ b/code/modules/lighting/lighting_atom.dm @@ -46,21 +46,13 @@ T.reconsider_lights() return ..() -/atom/movable/Move() - var/turf/old_loc = loc +/atom/Entered(atom/movable/obj, atom/prev_loc) . = ..() - if(loc != old_loc) - for(var/datum/light_source/L in light_sources) + if(obj && prev_loc != src) + for(var/datum/light_source/L in obj.light_sources) L.source_atom.update_light() - var/turf/new_loc = loc - if(istype(old_loc) && opacity) - old_loc.reconsider_lights() - - if(istype(new_loc) && opacity) - new_loc.reconsider_lights() - /atom/proc/set_opacity(new_opacity) var/old_opacity = opacity opacity = new_opacity diff --git a/code/modules/lighting/lighting_overlay.dm b/code/modules/lighting/lighting_overlay.dm index ca9d9b391f..2dd3889e4e 100644 --- a/code/modules/lighting/lighting_overlay.dm +++ b/code/modules/lighting/lighting_overlay.dm @@ -98,3 +98,5 @@ var/turf/T = loc if(istype(T)) T.lighting_overlay = null + + ..() diff --git a/code/modules/lighting/lighting_turf.dm b/code/modules/lighting/lighting_turf.dm index a7a5990709..e261931c41 100644 --- a/code/modules/lighting/lighting_turf.dm +++ b/code/modules/lighting/lighting_turf.dm @@ -16,3 +16,13 @@ if(A.lighting_use_dynamic) var/atom/movable/lighting_overlay/O = PoolOrNew(/atom/movable/lighting_overlay, src) lighting_overlay = O + +/turf/Entered(atom/movable/obj) + . = ..() + if(obj && obj.opacity) + reconsider_lights() + +/turf/Exited(atom/movable/obj) + . = ..() + if(obj && obj.opacity) + reconsider_lights() From 3461b7fb5cde5db9e3279d7471d8a37308e6f9c3 Mon Sep 17 00:00:00 2001 From: Mloc Date: Thu, 30 Jul 2015 19:05:00 +0100 Subject: [PATCH 4/5] minor antag distribution fix Signed-off-by: Mloc --- code/game/antagonist/antagonist.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/game/antagonist/antagonist.dm b/code/game/antagonist/antagonist.dm index efe744174b..4d2ff951ea 100644 --- a/code/game/antagonist/antagonist.dm +++ b/code/game/antagonist/antagonist.dm @@ -99,7 +99,7 @@ return 0 //Grab candidates randomly until we have enough. - while(candidates.len) + while(candidates.len && pending_antagonists.len < cur_max) var/datum/mind/player = pick(candidates) pending_antagonists |= player candidates -= player @@ -111,4 +111,4 @@ for(var/datum/mind/player in pending_antagonists) if(can_become_antag(player) && !player.special_role) add_antagonist(player,0,0,1) - pending_antagonists.Cut() \ No newline at end of file + pending_antagonists.Cut() From 4413356a63849ec4e34ab00a1e1577283fbd5012 Mon Sep 17 00:00:00 2001 From: Mloc Date: Thu, 30 Jul 2015 19:05:18 +0100 Subject: [PATCH 5/5] fix some weirdness with wall damage overlays Signed-off-by: Mloc --- code/game/turfs/simulated/wall_icon.dm | 26 +++++++++++++++++--------- code/game/turfs/simulated/walls.dm | 4 ++-- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/code/game/turfs/simulated/wall_icon.dm b/code/game/turfs/simulated/wall_icon.dm index fa6ee92855..364f58c29e 100644 --- a/code/game/turfs/simulated/wall_icon.dm +++ b/code/game/turfs/simulated/wall_icon.dm @@ -44,6 +44,7 @@ return overlays.Cut() + damage_overlay = 0 if(!wall_cache["[new_state]-[material.icon_colour]"]) var/image/I = image(icon='icons/turf/wall_masks.dmi',icon_state="[new_state]") @@ -74,7 +75,6 @@ check_relatives(1) /turf/simulated/wall/proc/update_icon() - if(!material) return @@ -86,15 +86,23 @@ else set_wall_state("[material.icon_base]fwall_open") - var/dmg_amt = material.integrity - if(reinf_material) - dmg_amt += reinf_material.integrity - var/overlay = round(damage / dmg_amt * damage_overlays.len) + 1 - if(overlay > damage_overlays.len) - overlay = damage_overlays.len - if(density) + if(damage == 0) + if(damage_overlay != 0) + overlays -= damage_overlays[damage_overlay] + damage_overlay = 0 + else if(density) + var/integrity = material.integrity + if(reinf_material) + integrity += reinf_material.integrity + + var/overlay = round(damage / integrity * damage_overlays.len) + 1 + if(overlay > damage_overlays.len) + overlay = damage_overlays.len + if(damage_overlay && overlay == damage_overlay) //No need to update. return + + if(damage_overlay) overlays -= damage_overlays[damage_overlay] overlays += damage_overlays[overlay] damage_overlay = overlay return @@ -131,4 +139,4 @@ /turf/simulated/wall/proc/can_join_with(var/turf/simulated/wall/W) if(material && W.material && material.icon_base == W.material.icon_base) return 1 - return 0 \ No newline at end of file + return 0 diff --git a/code/game/turfs/simulated/walls.dm b/code/game/turfs/simulated/walls.dm index 5185c9b81c..662c245da6 100644 --- a/code/game/turfs/simulated/walls.dm +++ b/code/game/turfs/simulated/walls.dm @@ -12,8 +12,8 @@ var/list/global/wall_cache = list() heat_capacity = 312500 //a little over 5 cm thick , 312500 for 1 m by 2.5 m by 0.25 m plasteel wall var/damage = 0 - var/damage_overlay - var/global/damage_overlays[8] + var/damage_overlay = 0 + var/global/damage_overlays[16] var/active var/can_open = 0 var/material/material