Made RCD code more efficient. (#25383)

This commit is contained in:
Charlie Nolan
2024-05-05 13:09:48 +00:00
committed by GitHub
parent a44ca02981
commit 64e2395bff
+2 -3
View File
@@ -266,7 +266,7 @@
if(!length(possible_actions))
possible_actions = list()
for(var/action_type in subtypesof(/datum/rcd_act))
possible_actions += action_type
possible_actions += new action_type()
spark_system = new /datum/effect_system/spark_spread
spark_system.set_up(5, 0, src)
@@ -572,8 +572,7 @@
if(!is_type_in_list(A, allowed_targets))
return FALSE
for(var/act_type in possible_actions)
var/datum/rcd_act/act = new act_type
for(var/datum/rcd_act/act in possible_actions)
if(act.can_act(A, src))
. = act.try_act(A, src, user)
update_icon(UPDATE_OVERLAYS)