Removes duplicate typecaches

This commit is contained in:
Jordan Brown
2017-10-23 09:24:41 -04:00
committed by CitadelStationBot
parent 095839becf
commit c51edc3bcd
15 changed files with 48 additions and 50 deletions
@@ -45,6 +45,9 @@
var/datum/personal_crafting/handcrafting
can_buckle = TRUE
buckle_lying = FALSE
can_ride_typecache = list(/mob/living/carbon/human, /mob/living/simple_animal/slime, /mob/living/simple_animal/parrot)
var/creamed = FALSE //to use with creampie overlays
<<<<<<< HEAD
=======
var/static/list/can_ride_typecache = typecacheof(list(/mob/living/carbon/human, /mob/living/simple_animal/slime, /mob/living/simple_animal/parrot))
>>>>>>> 8e434b7... Removes duplicate typecaches (#31883)
@@ -95,7 +95,7 @@
can_buckle = TRUE
buckle_lying = FALSE
can_ride_typecache = list(/mob/living/carbon/human)
var/static/list/can_ride_typecache = typecacheof(/mob/living/carbon/human)
/mob/living/silicon/robot/get_cell()
return cell
@@ -41,7 +41,7 @@
/mob/living/simple_animal/hostile/syndicate/mecha_pilot/no_mech/Initialize()
. = ..()
wanted_objects = typecacheof(/obj/mecha/combat, ignore_root_path=TRUE)
wanted_objects = typecacheof(/obj/mecha/combat, TRUE)
/mob/living/simple_animal/hostile/syndicate/mecha_pilot/nanotrasen //nanotrasen are syndies! no it's just a weird path.
name = "Nanotrasen Mecha Pilot"
@@ -101,7 +101,7 @@
targets_from = src
//Find a new mecha
wanted_objects = typecacheof(/obj/mecha/combat, ignore_root_path=TRUE)
wanted_objects = typecacheof(/obj/mecha/combat, TRUE)
var/search_aggressiveness = 2
for(var/obj/mecha/combat/C in range(vision_range,src))
if(is_valid_mecha(C))
@@ -663,12 +663,7 @@ Difficulty: Very Hard
activation_method = ACTIVATE_TOUCH
cooldown_add = 50
activation_sound = 'sound/magic/timeparadox2.ogg'
var/list/banned_items_typecache = list(/obj/item/storage, /obj/item/implant, /obj/item/implanter, /obj/item/disk/nuclear, /obj/item/projectile, /obj/item/spellbook)
/obj/machinery/anomalous_crystal/refresher/Initialize()
. = ..()
banned_items_typecache = typecacheof(banned_items_typecache)
var/static/list/banned_items_typecache = typecacheof(list(/obj/item/storage, /obj/item/implant, /obj/item/implanter, /obj/item/disk/nuclear, /obj/item/projectile, /obj/item/spellbook))
/obj/machinery/anomalous_crystal/refresher/ActivationReaction(mob/user, method)
if(..())
@@ -172,16 +172,9 @@ GLOBAL_LIST_INIT(AISwarmerCapsByType, list(/mob/living/simple_animal/hostile/swa
search_objects = 1
attack_all_objects = TRUE //attempt to nibble everything
lose_patience_timeout = 150
var/static/list/sharedWanted = list(/turf/closed/mineral, /turf/closed/wall) //eat rocks and walls
var/static/list/sharedWanted = typecacheof(list(/turf/closed/mineral, /turf/closed/wall)) //eat rocks and walls
var/static/list/sharedIgnore = list()
/mob/living/simple_animal/hostile/swarmer/ai/resource/Initialize()
. = ..()
sharedWanted = typecacheof(sharedWanted)
sharedIgnore = typecacheof(sharedIgnore)
//This handles viable things to eat/attack
//Place specific cases of AI derpiness here
//Most can be left to the automatic Gain/LosePatience() system
@@ -239,18 +232,15 @@ GLOBAL_LIST_INIT(AISwarmerCapsByType, list(/mob/living/simple_animal/hostile/swa
//So swarmers can learn what is and isn't food
/mob/living/simple_animal/hostile/swarmer/ai/resource/proc/add_type_to_wanted(typepath)
LAZYINITLIST(sharedWanted)
if(!sharedWanted[typepath])// this and += is faster than |=
sharedWanted += typecacheof(typepath)
/mob/living/simple_animal/hostile/swarmer/ai/resource/proc/add_type_to_ignore(typepath)
LAZYINITLIST(sharedIgnore)
if(!sharedIgnore[typepath])
sharedIgnore += typecacheof(typepath)
//RANGED SWARMER
/mob/living/simple_animal/hostile/swarmer/ai/ranged_combat
icon_state = "swarmer_ranged"
+3
View File
@@ -26,8 +26,11 @@
else
GLOB.living_mob_list += src
prepare_huds()
<<<<<<< HEAD
can_ride_typecache = typecacheof(can_ride_typecache)
hook_vr("mob_new",list(src))
=======
>>>>>>> 8e434b7... Removes duplicate typecaches (#31883)
for(var/v in GLOB.active_alternate_appearances)
if(!v)
continue
-1
View File
@@ -140,7 +140,6 @@
var/list/observers = null //The list of people observing this mob.
var/list/progressbars = null //for stacking do_after bars
var/list/can_ride_typecache = list()
var/list/mousemove_intercept_objects