mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-22 12:41:09 +01:00
[no gbp] Fixes a small mistake with helper proc (#93748)
This commit is contained in:
@@ -546,21 +546,21 @@
|
||||
* e.g. pick_n(list_of_stuff, 10) would return a list of 10 items from the list, chosen randomly.
|
||||
*/
|
||||
/proc/pick_n(list/list_to_pick, n)
|
||||
var/list_to_pick_length = length(list_to_pick)
|
||||
if(!islist(list_to_pick) || !list_to_pick_length || n <= 0)
|
||||
var/list_to_pick_length
|
||||
if(islist(list_to_pick))
|
||||
list_to_pick_length = length(list_to_pick)
|
||||
|
||||
if(!list_to_pick_length || n <= 0)
|
||||
return list()
|
||||
|
||||
/// The final list that gets returned
|
||||
var/list/result
|
||||
/// length of our list_to_pick
|
||||
n = min(n, list_to_pick_length)
|
||||
|
||||
// Shuffle and slice the first n indices
|
||||
var/list/copy_to_shuffle = list_to_pick.Copy()
|
||||
shuffle(copy_to_shuffle)
|
||||
result = copy_to_shuffle.Copy(1, n + 1)
|
||||
shuffle_inplace(copy_to_shuffle)
|
||||
|
||||
return result
|
||||
return copy_to_shuffle.Copy(1, n + 1)
|
||||
|
||||
/**
|
||||
* Given a list, return a copy where values without defined weights are given weight 1.
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
else
|
||||
var/obj/structure/spacevine/vine = new()
|
||||
var/list/floor_candidates = list()
|
||||
for(var/area/station/hallway/area in shuffle(GLOB.areas.Copy()))
|
||||
for(var/area/station/hallway/area in shuffle(GLOB.areas))
|
||||
for(var/turf/open/floor in area.get_turfs_from_all_zlevels())
|
||||
if(isopenspaceturf(floor))
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user