From 8d5d7d1d50a59441667af910c0bd008f26f600b2 Mon Sep 17 00:00:00 2001 From: BordListian Date: Mon, 15 Jan 2018 21:09:20 +0100 Subject: [PATCH] - Fixes smoke and foam having 1/4th of the reagents they should have (yoooo) - Fixes copy_to runtiming if you transfer from a container that contains nothing directly to a reagents datum - Removes redundant total_volume check in trans_to - Fixes cryostylane and pyrosium not heating up people - Fixes cryostylane cooling beakers to negative kelvins - Fixes cryostylane cooling people to negative kelvins (stop copypasting code for temperature) --- code/game/objects/effects/effect_system/effects_foam.dm | 2 +- code/game/objects/effects/effect_system/effects_smoke.dm | 2 +- code/modules/reagents/chemistry/holder.dm | 6 +++--- .../reagents/chemistry/reagents/pyrotechnic_reagents.dm | 2 +- code/modules/reagents/chemistry/recipes/pyrotechnics.dm | 4 +++- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/code/game/objects/effects/effect_system/effects_foam.dm b/code/game/objects/effects/effect_system/effects_foam.dm index f5754029eb..5d3a345e8c 100644 --- a/code/game/objects/effects/effect_system/effects_foam.dm +++ b/code/game/objects/effects/effect_system/effects_foam.dm @@ -189,7 +189,7 @@ location = get_turf(loca) amount = round(sqrt(amt / 2), 1) - carry.copy_to(chemholder, 4*carry.total_volume) //The foam holds 4 times the total reagents volume for balance purposes. + carry.copy_to(chemholder, carry.total_volume, 4) //The foam holds 4 times the total reagents volume for balance purposes. /datum/effect_system/foam_spread/metal/set_up(amt=5, loca, datum/reagents/carry = null, metaltype) ..() diff --git a/code/game/objects/effects/effect_system/effects_smoke.dm b/code/game/objects/effects/effect_system/effects_smoke.dm index 4dc985c9a1..b0991461ec 100644 --- a/code/game/objects/effects/effect_system/effects_smoke.dm +++ b/code/game/objects/effects/effect_system/effects_smoke.dm @@ -271,7 +271,7 @@ else location = get_turf(loca) amount = radius - carry.copy_to(chemholder, 4*carry.total_volume) //The smoke holds 4 times the total reagents volume for balance purposes. + carry.copy_to(chemholder, carry.total_volume, 4) //The smoke holds 4 times the total reagents volume for balance purposes. if(!silent) var/contained = "" diff --git a/code/modules/reagents/chemistry/holder.dm b/code/modules/reagents/chemistry/holder.dm index 08a087dbac..6080763548 100644 --- a/code/modules/reagents/chemistry/holder.dm +++ b/code/modules/reagents/chemistry/holder.dm @@ -158,7 +158,7 @@ if(istype(target, /datum/reagents)) R = target else - if(!target.reagents || src.total_volume<=0) + if(!target.reagents) return R = target.reagents amount = min(min(amount, src.total_volume), R.maximum_volume-R.total_volume) @@ -181,14 +181,14 @@ /datum/reagents/proc/copy_to(obj/target, amount=1, multiplier=1, preserve_data=1) var/list/cached_reagents = reagent_list - if(!target) + if(!target || !total_volume) return var/datum/reagents/R if(istype(target, /datum/reagents)) R = target else - if(!target.reagents || src.total_volume<=0) + if(!target.reagents) return R = target.reagents diff --git a/code/modules/reagents/chemistry/reagents/pyrotechnic_reagents.dm b/code/modules/reagents/chemistry/reagents/pyrotechnic_reagents.dm index 526a2602b6..7f4e481a29 100644 --- a/code/modules/reagents/chemistry/reagents/pyrotechnic_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/pyrotechnic_reagents.dm @@ -187,7 +187,7 @@ /datum/reagent/cryostylane/on_mob_life(mob/living/M) //TODO: code freezing into an ice cube if(M.reagents.has_reagent("oxygen")) M.reagents.remove_reagent("oxygen", 0.5) - M.bodytemperature -= 15 + M.bodytemperature = max(M.bodytemperature - 15,0) ..() /datum/reagent/cryostylane/reaction_turf(turf/T, reac_volume) diff --git a/code/modules/reagents/chemistry/recipes/pyrotechnics.dm b/code/modules/reagents/chemistry/recipes/pyrotechnics.dm index b77dcc435a..9f11498ee5 100644 --- a/code/modules/reagents/chemistry/recipes/pyrotechnics.dm +++ b/code/modules/reagents/chemistry/recipes/pyrotechnics.dm @@ -346,15 +346,17 @@ id = "cryostylane_oxygen" results = list("cryostylane" = 1) required_reagents = list("cryostylane" = 1, "oxygen" = 1) + mob_react = FALSE /datum/chemical_reaction/cryostylane_oxygen/on_reaction(datum/reagents/holder, created_volume) - holder.chem_temp -= 10*created_volume + holder.chem_temp = max(holder.chem_temp - 10*created_volume,0) /datum/chemical_reaction/pyrosium_oxygen name = "ephemeral pyrosium reaction" id = "pyrosium_oxygen" results = list("pyrosium" = 1) required_reagents = list("pyrosium" = 1, "oxygen" = 1) + mob_react = FALSE /datum/chemical_reaction/pyrosium_oxygen/on_reaction(datum/reagents/holder, created_volume) holder.chem_temp += 10*created_volume