Optimize a couple things

This commit is contained in:
Chompstation Bot
2021-07-20 21:30:20 +00:00
parent 4a6c523aa6
commit 15cafbe65b
262 changed files with 9437 additions and 934 deletions

View File

@@ -111,8 +111,7 @@ GLOBAL_LIST_EMPTY(all_blobs)
shuffle_inplace(blobs_to_affect)
for(var/L in blobs_to_affect)
var/obj/structure/blob/B = L
for(var/obj/structure/blob/B as anything in blobs_to_affect)
if(B.faction != faction)
continue

View File

@@ -197,8 +197,7 @@ var/list/blob_cores = list()
if(!difficulty_threshold)
return
var/list/valid_types = list()
for(var/thing in subtypesof(/datum/blob_type))
var/datum/blob_type/BT = thing
for(var/datum/blob_type/BT as anything in subtypesof(/datum/blob_type))
if(initial(BT.difficulty) > difficulty_threshold) // Too hard.
continue
if(initial(BT.difficulty) < difficulty_floor) // Too easy.

View File

@@ -57,14 +57,12 @@ var/list/overminds = list()
return ..(newloc)
/mob/observer/blob/Destroy()
for(var/BL in GLOB.all_blobs)
var/obj/structure/blob/B = BL
for(var/obj/structure/blob/B as anything in GLOB.all_blobs)
if(B && B.overmind == src)
B.overmind = null
B.update_icon() //reset anything that was ours
for(var/BLO in blob_mobs)
var/mob/living/simple_mob/blob/spore/BM = BLO
for(var/mob/living/simple_mob/blob/spore/BM as anything in blob_mobs)
if(BM)
BM.overmind = null
BM.update_icons()

View File

@@ -34,8 +34,7 @@
if(!istype(C, /obj/structure/blob/core) && !istype(C, /obj/structure/blob/node) && C.overmind && (C.overmind == B.overmind) ) //if it doesn't have the same 'ownership' or is a core or node, don't split damage to it
blobs_to_hurt += C
for(var/thing in blobs_to_hurt)
var/obj/structure/blob/C = thing
for(var/obj/structure/blob/C as anything in blobs_to_hurt)
if(C == B)
continue // We'll damage this later.