diff --git a/code/datums/achievements/_achievement_data.dm b/code/datums/achievements/_achievement_data.dm index 2a000c15557..b6e2cf3f7a9 100644 --- a/code/datums/achievements/_achievement_data.dm +++ b/code/datums/achievements/_achievement_data.dm @@ -30,7 +30,7 @@ /datum/achievement_data/proc/load_all_achievements() set waitfor = FALSE - + var/list/kv = list() var/datum/DBQuery/Query = SSdbcore.NewQuery("SELECT achievement_key,value FROM [format_table_name("achievements")] WHERE ckey = '[sanitizeSQL(owner_ckey)]'") if(!Query.Execute()) @@ -61,6 +61,8 @@ ///Unlocks an achievement of a specific type. /datum/achievement_data/proc/unlock(achievement_type, mob/user) + if(!SSachievements.achievements_enabled) + return var/datum/award/A = SSachievements.awards[achievement_type] get_data(achievement_type) //Get the current status first if necessary if(istype(A, /datum/award/achievement)) @@ -75,6 +77,8 @@ ///Resets an achievement to default values. /datum/achievement_data/proc/reset(achievement_type) + if(!SSachievements.achievements_enabled) + return var/datum/award/A = SSachievements.awards[achievement_type] get_data(achievement_type) if(istype(A, /datum/award/achievement)) diff --git a/code/datums/status_effects/status_effect.dm b/code/datums/status_effects/status_effect.dm index fbd3b2cc299..112d17c4e72 100644 --- a/code/datums/status_effects/status_effect.dm +++ b/code/datums/status_effects/status_effect.dm @@ -143,7 +143,7 @@ var/stacks = 0 //how many stacks are accumulated, also is # of stacks that target will have when first applied var/delay_before_decay //deciseconds until ticks start occuring, which removes stacks (first stack will be removed at this time plus tick_interval) tick_interval = 10 //deciseconds between decays once decay starts - var/stack_decay = 1 //how many stacks are lost per tick (decay trigger) + var/stack_decay = 1 //how many stacks are lost per tick (decay trigger) var/stack_threshold //special effects trigger when stacks reach this amount var/max_stacks //stacks cannot exceed this amount var/consumed_on_threshold = TRUE //if status should be removed once threshold is crossed @@ -151,7 +151,7 @@ var/overlay_file var/underlay_file var/overlay_state // states in .dmi must be given a name followed by a number which corresponds to a number of stacks. put the state name without the number in these state vars - var/underlay_state // the number is concatonated onto the string based on the number of stacks to get the correct state name + var/underlay_state // the number is concatonated onto the string based on the number of stacks to get the correct state name var/mutable_appearance/status_overlay var/mutable_appearance/status_underlay @@ -194,6 +194,8 @@ if(stacks >= stack_threshold && !threshold_crossed) //threshold_crossed check prevents threshold effect from occuring if changing from above threshold to still above threshold threshold_crossed = TRUE on_threshold_cross() + if(consumed_on_threshold) + return else if(stacks < stack_threshold && threshold_crossed) threshold_crossed = FALSE //resets threshold effect if we fall below threshold so threshold effect can trigger again on_threshold_drop() @@ -205,13 +207,14 @@ owner.add_overlay(status_overlay) owner.underlays += status_underlay else - fadeout_effect() + fadeout_effect() qdel(src) //deletes status if stacks fall under one /datum/status_effect/stacking/on_creation(mob/living/new_owner, stacks_to_apply) - ..() - src.add_stacks(stacks_to_apply) - + . = ..() + if(.) + add_stacks(stacks_to_apply) + /datum/status_effect/stacking/on_apply() if(!can_have_status()) return FALSE diff --git a/code/modules/mob/living/carbon/life.dm b/code/modules/mob/living/carbon/life.dm index 1783d370f0a..72200d457e6 100644 --- a/code/modules/mob/living/carbon/life.dm +++ b/code/modules/mob/living/carbon/life.dm @@ -333,7 +333,8 @@ if(stat != DEAD) for(var/V in internal_organs) var/obj/item/organ/O = V - O.on_life() + if(O.owner) // This exist mostly because reagent metabolization can cause organ reshuffling + O.on_life() else if(reagents.has_reagent(/datum/reagent/toxin/formaldehyde, 1)) // No organ decay if the body contains formaldehyde. return diff --git a/code/modules/research/nanites/nanite_programs/healing.dm b/code/modules/research/nanites/nanite_programs/healing.dm index c0c6e0361d7..844d9809a9c 100644 --- a/code/modules/research/nanites/nanite_programs/healing.dm +++ b/code/modules/research/nanites/nanite_programs/healing.dm @@ -53,7 +53,7 @@ rogue_types = list(/datum/nanite_program/suffocating, /datum/nanite_program/necrotic) /datum/nanite_program/purging/check_conditions() - var/foreign_reagent = LAZYLEN(host_mob.reagents.reagent_list) + var/foreign_reagent = length(host_mob.reagents?.reagent_list) if(!host_mob.getToxLoss() && !foreign_reagent) return FALSE return ..()