Nanite programs with triggers won't ignore rules (#56516)

* Added condition check to the trigger function

* Reversed the statement

* Updated the comment
This commit is contained in:
Andrew
2021-02-01 21:44:43 +01:00
committed by GitHub
parent b09006637a
commit f4f754cd2a
@@ -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