mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
Optimize a couple things
This commit is contained in:
@@ -79,8 +79,7 @@
|
||||
// Counts living carp spawned by this event.
|
||||
/datum/event/carp_migration/proc/count_spawned_carps()
|
||||
. = 0
|
||||
for(var/I in spawned_carp)
|
||||
var/mob/living/simple_mob/animal/M = I
|
||||
for(var/mob/living/simple_mob/animal/M as anything in spawned_carp)
|
||||
if(!QDELETED(M) && M.stat != DEAD)
|
||||
. += 1
|
||||
|
||||
|
||||
@@ -32,8 +32,7 @@
|
||||
|
||||
/datum/event/grub_infestation/end()
|
||||
var/list/area_names = list()
|
||||
for(var/grub in existing_solargrubs)
|
||||
var/mob/living/G = grub
|
||||
for(var/mob/living/G as anything in existing_solargrubs)
|
||||
if(!G || G.stat == DEAD)
|
||||
continue
|
||||
var/area/grub_area = get_area(G)
|
||||
|
||||
@@ -252,7 +252,7 @@
|
||||
//
|
||||
|
||||
/datum/event/supply_demand/proc/choose_food_items(var/differentTypes)
|
||||
var/list/types = typesof(/datum/recipe) - /datum/recipe
|
||||
var/list/types = subtypesof(/datum/recipe)
|
||||
for(var/i in 1 to differentTypes)
|
||||
var/datum/recipe/R = pick(types)
|
||||
types -= R // Don't pick the same thing twice
|
||||
@@ -262,7 +262,7 @@
|
||||
return
|
||||
|
||||
/datum/event/supply_demand/proc/choose_research_items(var/differentTypes)
|
||||
var/list/types = typesof(/datum/design) - /datum/design
|
||||
var/list/types = subtypesof(/datum/design)
|
||||
for(var/i in 1 to differentTypes)
|
||||
var/datum/design/D = pick(types)
|
||||
types -= D // Don't pick the same thing twice
|
||||
@@ -327,7 +327,7 @@
|
||||
return
|
||||
|
||||
/datum/event/supply_demand/proc/choose_alloy_items(var/differentTypes)
|
||||
var/list/types = typesof(/datum/alloy) - /datum/alloy
|
||||
var/list/types = subtypesof(/datum/alloy)
|
||||
for(var/i in 1 to differentTypes)
|
||||
var/datum/alloy/A = pick(types)
|
||||
types -= A // Don't pick the same thing twice
|
||||
|
||||
Reference in New Issue
Block a user