Merge pull request #28435 from lzimann/typecaches

Changes a lot of is_type_in_list to use a typecache
This commit is contained in:
Joan Lung
2017-06-17 12:33:03 -04:00
committed by GitHub
11 changed files with 57 additions and 59 deletions
+4 -1
View File
@@ -50,6 +50,9 @@
/obj/item/weapon/reagent_containers/food/snacks/grown/ambrosia/deus,
/obj/item/weapon/reagent_containers/food/snacks/grown/wheat)
/obj/item/weapon/grown/log/Initialize()
. = ..()
accepted = typecacheof(accepted)
/obj/item/weapon/grown/log/attackby(obj/item/weapon/W, mob/user, params)
if(W.sharpness)
@@ -66,7 +69,7 @@
to_chat(user, "<span class='notice'>You add the newly-formed [plank_name] to the stack. It now contains [plank.amount] [plank_name].</span>")
qdel(src)
if(is_type_in_list(W,accepted))
if(is_type_in_typecache(W,accepted))
var/obj/item/weapon/reagent_containers/food/snacks/grown/leaf = W
if(leaf.dry)
user.show_message("<span class='notice'>You wrap \the [W] around the log, turning it into a torch!</span>")