diff --git a/code/controllers/emergency_shuttle_controller.dm b/code/controllers/emergency_shuttle_controller.dm index 5dbfeb427a..2229c4febc 100644 --- a/code/controllers/emergency_shuttle_controller.dm +++ b/code/controllers/emergency_shuttle_controller.dm @@ -35,7 +35,12 @@ var/global/datum/emergency_shuttle_controller/emergency_shuttle if (!shuttle.location) //leaving from the station //launch the pods! - for (var/datum/shuttle/ferry/escape_pod/pod in escape_pods) + for (var/EP in escape_pods) + var/datum/shuttle/ferry/escape_pod/pod + if(istype(escape_pods[EP], /datum/shuttle/ferry/escape_pod)) + pod = escape_pods[EP] + else + continue if (!pod.arming_controller || pod.arming_controller.armed) pod.launch(src) @@ -57,7 +62,12 @@ var/global/datum/emergency_shuttle_controller/emergency_shuttle //arm the escape pods if (evac) - for (var/datum/shuttle/ferry/escape_pod/pod in escape_pods) + for (var/EP in escape_pods) + var/datum/shuttle/ferry/escape_pod/pod + if(istype(escape_pods[EP], /datum/shuttle/ferry/escape_pod)) + pod = escape_pods[EP] + else + continue if (pod.arming_controller) pod.arming_controller.arm() diff --git a/code/controllers/subsystems/nanoui.dm b/code/controllers/subsystems/nanoui.dm index e7f0d3c249..e622fce8f2 100644 --- a/code/controllers/subsystems/nanoui.dm +++ b/code/controllers/subsystems/nanoui.dm @@ -1,6 +1,6 @@ SUBSYSTEM_DEF(nanoui) name = "NanoUI" - wait = 20 + wait = 5 // a list of current open /nanoui UIs, grouped by src_object and ui_key var/list/open_uis = list() // a list of current open /nanoui UIs, not grouped, for use in processing @@ -13,7 +13,7 @@ SUBSYSTEM_DEF(nanoui) "nano/css/",\ "nano/images/",\ "nano/images/status_icons/",\ - "nano/images/modular_computers/", + "nano/images/modular_computers/",\ "nano/js/",\ "nano/templates/"\ ) @@ -25,7 +25,9 @@ SUBSYSTEM_DEF(nanoui) if(copytext(filename, length(filename)) != "/") // filenames which end in "/" are actually directories, which we want to ignore if(fexists(path + filename)) asset_files.Add(fcopy_rsc(path + filename)) // add this file to asset_files for sending to clients when they connect - return ..() + .=..() + for(var/i in GLOB.clients) + send_resources(i) /datum/controller/subsystem/nanoui/Recover() if(SSnanoui.open_uis) @@ -42,3 +44,10 @@ SUBSYSTEM_DEF(nanoui) for(var/thing in processing_uis) var/datum/nanoui/UI = thing UI.process() + +//Sends asset files to a client, called on client/New() +/datum/controller/subsystem/nanoui/proc/send_resources(client) + if(!subsystem_initialized) + return + for(var/file in asset_files) + client << browse_rsc(file) // send the file to the client \ No newline at end of file diff --git a/code/controllers/subsystems/processing/chemistry.dm b/code/controllers/subsystems/processing/chemistry.dm index 67b74d3ab6..34094f9fe3 100644 --- a/code/controllers/subsystems/processing/chemistry.dm +++ b/code/controllers/subsystems/processing/chemistry.dm @@ -4,6 +4,7 @@ PROCESSING_SUBSYSTEM_DEF(chemistry) flags = SS_BACKGROUND|SS_POST_FIRE_TIMING init_order = INIT_ORDER_CHEMISTRY var/list/chemical_reactions = list() + var/list/chemical_reactions_by_reagent = list() var/list/chemical_reagents = list() /datum/controller/subsystem/processing/chemistry/Recover() @@ -22,15 +23,16 @@ PROCESSING_SUBSYSTEM_DEF(chemistry) // more than one chemical it will still only appear in only one of the sublists. /datum/controller/subsystem/processing/chemistry/proc/initialize_chemical_reactions() var/paths = typesof(/datum/chemical_reaction) - /datum/chemical_reaction - SSchemistry.chemical_reactions = list() + chemical_reactions = list() + chemical_reactions_by_reagent = list() for(var/path in paths) - var/datum/chemical_reaction/D = new path() + var/datum/chemical_reaction/D = new path + chemical_reactions += D if(D.required_reagents && D.required_reagents.len) var/reagent_id = D.required_reagents[1] - if(!chemical_reactions[reagent_id]) - chemical_reactions[reagent_id] = list() - chemical_reactions[reagent_id] += D + LAZYINITLIST(chemical_reactions_by_reagent[reagent_id]) + chemical_reactions_by_reagent[reagent_id] += D //Chemical Reagents - Initialises all /datum/reagent into a list indexed by reagent id /datum/controller/subsystem/processing/chemistry/proc/initialize_chemical_reagents() diff --git a/code/modules/food/food/snacks.dm b/code/modules/food/food/snacks.dm index 4e69bfe363..fe62dcd082 100644 --- a/code/modules/food/food/snacks.dm +++ b/code/modules/food/food/snacks.dm @@ -16,7 +16,7 @@ var/list/nutriment_desc = list("food" = 1) center_of_mass = list("x"=16, "y"=16) w_class = ITEMSIZE_SMALL - force = 1 + force = 0 /obj/item/weapon/reagent_containers/food/snacks/Initialize() . = ..() @@ -3878,4 +3878,4 @@ . = ..() reagents.add_reagent("nutriment", 6) reagents.add_reagent("protein", 4) - bitesize = 3 \ No newline at end of file + bitesize = 3 diff --git a/code/modules/hydroponics/grown.dm b/code/modules/hydroponics/grown.dm index 34b2a1e78f..87ca12a170 100644 --- a/code/modules/hydroponics/grown.dm +++ b/code/modules/hydroponics/grown.dm @@ -62,6 +62,8 @@ update_desc() if(reagents.total_volume > 0) bitesize = 1+round(reagents.total_volume / 2, 1) + if(seed.get_trait(TRAIT_STINGS)) + force = 1 /obj/item/weapon/reagent_containers/food/snacks/grown/proc/update_desc() diff --git a/code/modules/hydroponics/seed.dm b/code/modules/hydroponics/seed.dm index 9ed2d836a6..0ec87dca8a 100644 --- a/code/modules/hydroponics/seed.dm +++ b/code/modules/hydroponics/seed.dm @@ -728,6 +728,9 @@ clr = get_trait(TRAIT_BIOLUM_COLOUR) product.set_light(get_trait(TRAIT_BIOLUM), l_color = clr) + if(get_trait(TRAIT_STINGS)) + product.force = 1 + //Handle spawning in living, mobile products (like dionaea). if(istype(product,/mob/living)) product.visible_message("The pod disgorges [product]!") diff --git a/code/modules/nano/nanomanager.dm b/code/modules/nano/nanomanager.dm index afa779895a..69b0e7b77e 100644 --- a/code/modules/nano/nanomanager.dm +++ b/code/modules/nano/nanomanager.dm @@ -221,18 +221,4 @@ oldMob.open_uis.Cut() - return 1 // success - - /** - * Sends all nano assets to the client - * This is called on user login - * - * @param client /client The user's client - * - * @return nothing - */ - -/datum/controller/subsystem/nanoui/proc/send_resources(client) - for(var/file in asset_files) - client << browse_rsc(file) // send the file to the client - + return 1 // success \ No newline at end of file diff --git a/code/modules/reagents/Chemistry-Holder.dm b/code/modules/reagents/Chemistry-Holder.dm index 2d906381d1..467d7c37a9 100644 --- a/code/modules/reagents/Chemistry-Holder.dm +++ b/code/modules/reagents/Chemistry-Holder.dm @@ -77,41 +77,31 @@ return /datum/reagents/proc/handle_reactions() - START_PROCESSING(SSchemistry, src) - -//returns 1 if the holder should continue reactiong, 0 otherwise. -/datum/reagents/process() - if(QDELETED(my_atom)) //No container, no reaction. - return PROCESS_KILL - if(my_atom.flags & NOREACT) // No reactions here - return PROCESS_KILL - - var/reaction_occured - var/list/effect_reactions = list() + if(QDELETED(my_atom)) + return FALSE + if(my_atom.flags & NOREACT) + return FALSE + var/reaction_occurred var/list/eligible_reactions = list() - for(var/i in 1 to PROCESS_REACTION_ITER) - reaction_occured = 0 + var/list/effect_reactions = list() + do + reaction_occurred = FALSE + for(var/i in reagent_list) + var/datum/reagent/R = i + if(SSchemistry.chemical_reactions_by_reagent[R.id]) + eligible_reactions |= SSchemistry.chemical_reactions_by_reagent[R.id] - //need to rebuild this to account for chain reactions - for(var/datum/reagent/R in reagent_list) - eligible_reactions |= SSchemistry.chemical_reactions[R.id] - - for(var/datum/chemical_reaction/C in eligible_reactions) + for(var/i in eligible_reactions) + var/datum/chemical_reaction/C = i if(C.can_happen(src) && C.process(src)) effect_reactions |= C - reaction_occured = 1 - - eligible_reactions.Cut() - - if(!reaction_occured) - break - - for(var/datum/chemical_reaction/C in effect_reactions) + reaction_occurred = TRUE + eligible_reactions.len = 0 + while(reaction_occurred) + for(var/i in effect_reactions) + var/datum/chemical_reaction/C = i C.post_reaction(src) - update_total() - if(!reaction_occured) - return PROCESS_KILL /* Holder-to-chemical */ diff --git a/html/changelogs/Novacat - nanochemistry.yml b/html/changelogs/Novacat - nanochemistry.yml new file mode 100644 index 0000000000..dab2b22861 --- /dev/null +++ b/html/changelogs/Novacat - nanochemistry.yml @@ -0,0 +1,37 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscadd (general adding of nice things) +# rscdel (general deleting of nice things) +# imageadd +# imagedel +# maptweak +# spellcheck (typo fixes) +# experiment +################################# + +# Your name. +author: Novacat + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries. +# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog. +changes: + - tweak: "Chemistry processes instantly again." + - tweak: "Nanoui sends stuff even after client connect." diff --git a/polaris.dme b/polaris.dme index b01cdb7902..8cdfceb3a4 100644 --- a/polaris.dme +++ b/polaris.dme @@ -2448,6 +2448,7 @@ #include "code\modules\research\designs\medical.dm" #include "code\modules\research\designs\mining_toys.dm" #include "code\modules\research\designs\misc.dm" +#include "code\modules\research\designs\modular_computer.dm" #include "code\modules\research\designs\pdas.dm" #include "code\modules\research\designs\powercells.dm" #include "code\modules\research\designs\precursor.dm"