Ports Chemistry/NanoUI Fixes Early

Direct port of https://github.com/PolarisSS13/Polaris/pull/6039
This commit is contained in:
Unknown
2019-04-08 16:15:29 -04:00
parent 323ab0b1b0
commit dcd2a1f606
4 changed files with 36 additions and 49 deletions
+1 -15
View File
@@ -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
+18 -28
View File
@@ -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
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 */