From f4f754cd2a5e0b0a46cae7fe59c627cc4f8c53c1 Mon Sep 17 00:00:00 2001 From: Andrew Date: Mon, 1 Feb 2021 23:44:43 +0300 Subject: [PATCH] Nanite programs with triggers won't ignore rules (#56516) * Added condition check to the trigger function * Reversed the statement * Updated the comment --- code/modules/research/nanites/nanite_programs.dm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/code/modules/research/nanites/nanite_programs.dm b/code/modules/research/nanites/nanite_programs.dm index 2b52a728a06..a69e4e4f116 100644 --- a/code/modules/research/nanites/nanite_programs.dm +++ b/code/modules/research/nanites/nanite_programs.dm @@ -193,7 +193,7 @@ if(passive_enabled) disable_passive_effect() -//If false, disables active and passive effects, but doesn't consume nanites +//If false, disables active, passive effects, and triggers without consuming nanites //Can be used to avoid consuming nanites for nothing /datum/nanite_program/proc/check_conditions() if (!LAZYLEN(rules)) @@ -229,6 +229,8 @@ return if(world.time < next_trigger) return + if(!check_conditions()) + return if(!consume_nanites(trigger_cost)) return next_trigger = world.time + trigger_cooldown