diff --git a/code/__DEFINES/tgs.config.dm b/code/__DEFINES/tgs.config.dm index e0d5f1baac92..bd30a6707966 100644 --- a/code/__DEFINES/tgs.config.dm +++ b/code/__DEFINES/tgs.config.dm @@ -8,5 +8,5 @@ #define TGS_WARNING_LOG(message) log_world("TGS Warn: [##message]") #define TGS_ERROR_LOG(message) log_world("TGS Error: [##message]") #define TGS_NOTIFY_ADMINS(event) message_admins(##event) -#define TGS_CLIENT_COUNT GLOB.clients.len +#define TGS_CLIENT_COUNT length(GLOB.clients) #define TGS_PROTECT_DATUM(Path) GENERAL_PROTECT_DATUM(##Path) diff --git a/code/__DEFINES/traits.dm b/code/__DEFINES/traits.dm index 7b669124a2d0..964e77402655 100644 --- a/code/__DEFINES/traits.dm +++ b/code/__DEFINES/traits.dm @@ -233,6 +233,8 @@ #define TRAIT_IN_TUTORIAL "t_IN_TUTORIAL" /// If the mob is cloaked in any form #define TRAIT_CLOAKED "t_cloaked" +/// If the mob won't drop items held in face slot when downed +#define TRAIT_IRON_TEETH "t_iron_teeth" // -- ability traits -- /// Xenos with this trait cannot have plasma transfered to them diff --git a/code/__HELPERS/_lists.dm b/code/__HELPERS/_lists.dm index dd92b9be1295..e46c92df543a 100644 --- a/code/__HELPERS/_lists.dm +++ b/code/__HELPERS/_lists.dm @@ -103,7 +103,7 @@ /proc/bitfield_to_list(bitfield = 0, list/wordlist) var/list/return_list = list() if(islist(wordlist)) - var/max = min(wordlist.len, 24) + var/max = min(length(wordlist), 24) var/bit = 1 for(var/i in 1 to max) if(bitfield & bit) @@ -148,10 +148,10 @@ * Returns TRUE if the list had nulls, FALSE otherwise **/ /proc/list_clear_nulls(list/list_to_clear) - var/start_len = list_to_clear.len + var/start_len = length(list_to_clear) var/list/new_list = new(start_len) list_to_clear -= new_list - return list_to_clear.len < start_len + return length(list_to_clear) < start_len ///Return a list with no duplicate entries /proc/unique_list(list/inserted_list) @@ -174,6 +174,6 @@ if(!inserted_list) return - for(var/i in 1 to inserted_list.len - 1) - inserted_list.Swap(i, rand(i, inserted_list.len)) + for(var/i in 1 to length(inserted_list) - 1) + inserted_list.Swap(i, rand(i, length(inserted_list))) diff --git a/code/__HELPERS/chat.dm b/code/__HELPERS/chat.dm index 20d1a45b31cc..4629c699636a 100644 --- a/code/__HELPERS/chat.dm +++ b/code/__HELPERS/chat.dm @@ -22,7 +22,7 @@ if((!admin_only || channel.is_admin_channel) && (channel_tag in applicable_tags)) channels_to_use += channel - if(channels_to_use.len) + if(length(channels_to_use)) world.TgsChatBroadcast(message, channels_to_use) /** diff --git a/code/__HELPERS/game.dm b/code/__HELPERS/game.dm index 721c179b9cef..5bf36f785746 100644 --- a/code/__HELPERS/game.dm +++ b/code/__HELPERS/game.dm @@ -58,7 +58,7 @@ /proc/recursive_mob_check(atom/O, list/L = list(), recursion_limit = 3, client_check = 1, sight_check = 1, include_radio = 1) - //debug_mob += O.contents.len + //debug_mob += length(O.contents) if(!recursion_limit) return L for(var/atom/A in O.contents) @@ -294,7 +294,7 @@ * * cache_only - Whether to not actually send a to_chat message and instead only update larva_queue_cached_message */ /proc/message_alien_candidates(list/candidates, dequeued, cache_only = FALSE) - for(var/i in (1 + dequeued) to candidates.len) + for(var/i in (1 + dequeued) to length(candidates)) var/mob/dead/observer/cur_obs = candidates[i] // Generate the messages diff --git a/code/__HELPERS/guid.dm b/code/__HELPERS/guid.dm index 49903cceb3c3..e763aaf73b69 100644 --- a/code/__HELPERS/guid.dm +++ b/code/__HELPERS/guid.dm @@ -6,7 +6,7 @@ /proc/GUID() var/const/GUID_VERSION = "b" var/const/GUID_VARIANT = "d" - var/node_id = copytext_char(md5("[rand()*rand(1,9999999)][world.name][world.hub][world.hub_password][world.internet_address][world.address][world.contents.len][world.status][world.port][rand()*rand(1,9999999)]"), 1, 13) + var/node_id = copytext_char(md5("[rand()*rand(1,9999999)][world.name][world.hub][world.hub_password][world.internet_address][world.address][length(world.contents)][world.status][world.port][rand()*rand(1,9999999)]"), 1, 13) var/time_high = "[num2hex(text2num(time2text(world.realtime,"YYYY")), 2)][num2hex(world.realtime, 6)]" diff --git a/code/__HELPERS/icons.dm b/code/__HELPERS/icons.dm index 081fcec5a137..fcfb512e0c12 100644 --- a/code/__HELPERS/icons.dm +++ b/code/__HELPERS/icons.dm @@ -332,7 +332,7 @@ world /proc/getFlatIcon(image/appearance, defdir, deficon, defstate, defblend, start = TRUE, no_anim = FALSE, appearance_flags = FALSE) // Loop through the underlays, then overlays, sorting them into the layers list #define PROCESS_OVERLAYS_OR_UNDERLAYS(flat, process, base_layer) \ - for (var/i in 1 to process.len) { \ + for (var/i in 1 to length(process)) { \ var/image/current = process[i]; \ if (!current) { \ continue; \ @@ -347,7 +347,7 @@ world } \ current_layer = base_layer + appearance.layer + current_layer / 1000; \ } \ - for (var/index_to_compare_to in 1 to layers.len) { \ + for (var/index_to_compare_to in 1 to length(layers)) { \ var/compare_to = layers[index_to_compare_to]; \ if (current_layer < layers[compare_to]) { \ layers.Insert(index_to_compare_to, current); \ @@ -403,7 +403,7 @@ world var/curblend = appearance.blend_mode || defblend - if(appearance.overlays.len || appearance.underlays.len) + if(length(appearance.overlays) || length(appearance.underlays)) var/icon/flat = icon(flat_template) // Layers will be a sorted list of icons/overlays, based on the order in which they are displayed var/list/layers = list() @@ -556,7 +556,7 @@ world /proc/sort_atoms_by_layer(list/atoms) // Comb sort icons based on levels var/list/result = atoms.Copy() - var/gap = result.len + var/gap = length(result) var/swapped = 1 while (gap > 1 || swapped) swapped = 0 @@ -564,7 +564,7 @@ world gap = floor(gap / 1.3) // 1.3 is the emperic comb sort coefficient if(gap < 1) gap = 1 - for(var/i = 1; gap + i <= result.len; i++) + for(var/i = 1; gap + i <= length(result); i++) var/atom/l = result[i] //Fucking hate var/atom/r = result[gap+i] //how lists work here if(l.layer > r.layer) //no "result[i].layer" for me diff --git a/code/__HELPERS/lists.dm b/code/__HELPERS/lists.dm index 856a0a492cbb..d5212611a04b 100644 --- a/code/__HELPERS/lists.dm +++ b/code/__HELPERS/lists.dm @@ -12,7 +12,7 @@ //Returns a list in plain english as a string /proc/english_list(list/input, nothing_text = "nothing", and_text = " and ", comma_text = ", ", final_comma_text = "" ) - var/total = input.len + var/total = length(input) if (!total) return "[nothing_text]" else if (total == 1) @@ -33,9 +33,9 @@ //Returns list element or null. Should prevent "index out of bounds" error. /proc/listgetindex(list/list,index) - if(istype(list) && list.len) + if(istype(list) && length(list)) if(isnum(index)) - if(ISINRANGE(index,1,list.len)) + if(ISINRANGE(index,1,length(list))) return list[index] else if(list[index]) return list[index] @@ -106,35 +106,35 @@ /// Pick a random element from the list and remove it from the list. /proc/pick_n_take(list/L) RETURN_TYPE(L[_].type) - if(L.len) - var/picked = rand(1,L.len) + if(length(L)) + var/picked = rand(1,length(L)) . = L[picked] L.Cut(picked,picked+1) //Cut is far more efficient that Remove() //Returns the top(last) element from the list and removes it from the list (typical stack function) /proc/pop(list/L) - if(L.len) - . = L[L.len] + if(length(L)) + . = L[length(L)] L.len-- /proc/popleft(list/L) - if(L.len) + if(length(L)) . = L[1] L.Cut(1,2) //Returns the next element in parameter list after first appearance of parameter element. If it is the last element of the list or not present in list, returns first element. /proc/next_in_list(element, list/L) - for(var/i=1, i1, i--) + for(var/i=length(L), i>1, i--) if(L[i] == element) return L[i-1] - return L[L.len] + return L[length(L)] /* * Sorting @@ -144,7 +144,7 @@ /proc/reverselist(list/L) var/list/output = list() if(L) - for(var/i = L.len; i >= 1; i--) + for(var/i = length(L); i >= 1; i--) output += L[i] return output @@ -155,7 +155,7 @@ . = L_n var/L_o[] = L.Copy() var/i - while(L_o.len) + while(length(L_o)) i = pick(L_o) if(!ref) L_n += i else L_n[i] = L_o[i] @@ -171,9 +171,9 @@ //Mergesort: divides up the list into halves to begin the sort /proc/sortKey(list/client/L, order = 1) - if(isnull(L) || L.len < 2) + if(isnull(L) || length(L) < 2) return L - var/middle = L.len / 2 + 1 + var/middle = length(L) / 2 + 1 return mergeKey(sortKey(L.Copy(0,middle)), sortKey(L.Copy(middle)), order) //Mergsort: does the actual sorting and returns the results back to sortAtom @@ -181,7 +181,7 @@ var/Li=1 var/Ri=1 var/list/result = new() - while(Li <= L.len && Ri <= R.len) + while(Li <= length(L) && Ri <= length(R)) var/client/rL = L[Li] var/client/rR = R[Ri] if(sorttext(rL.ckey, rR.ckey) == order) @@ -189,20 +189,20 @@ else result += R[Ri++] - if(Li <= L.len) + if(Li <= length(L)) return (result + L.Copy(Li, 0)) return (result + R.Copy(Ri, 0)) // Quicksort implementation /proc/sortAtom(list/atom/L, order = 1) - if(isnull(L) || L.len < 2) + if(isnull(L) || length(L) < 2) return L var/startIndex = 1 var/list/atom/M = new/list() for(var/atom/mob in L) if(istype(mob)) M.Add(mob) - var/endIndex = M.len - 1 + var/endIndex = length(M) - 1 var/top = 0 var/list/stack[endIndex*2] stack[++top] = startIndex @@ -241,9 +241,9 @@ /proc/sortRecord(list/datum/data/record/L, field = "name", order = 1) if(isnull(L)) return list() - if(L.len < 2) + if(length(L) < 2) return L - var/middle = L.len / 2 + 1 + var/middle = length(L) / 2 + 1 return mergeRecordLists(sortRecord(L.Copy(0, middle), field, order), sortRecord(L.Copy(middle), field, order), field, order) //Mergsort: does the actual sorting and returns the results back to sortRecord @@ -252,7 +252,7 @@ var/Ri=1 var/list/result = new() if(!isnull(L) && !isnull(R)) - while(Li <= L.len && Ri <= R.len) + while(Li <= length(L) && Ri <= length(R)) var/datum/data/record/rL = L[Li] if(isnull(rL)) L -= rL @@ -266,7 +266,7 @@ else result += R[Ri++] - if(Li <= L.len) + if(Li <= length(L)) return (result + L.Copy(Li, 0)) return (result + R.Copy(Ri, 0)) @@ -285,9 +285,9 @@ RETURN_TYPE(/list) if(!istype(L)) return - if(L.len < 2) + if(length(L) < 2) return L - var/middle = L.len / 2 + 1 // Copy is first,second-1 + var/middle = length(L) / 2 + 1 // Copy is first,second-1 return mergeLists(sortList(L.Copy(0,middle)), sortList(L.Copy(middle))) //second parameter null = to end of list //Mergsorge: uses sortList() but uses the var's name specifically. This should probably be using mergeAtom() instead @@ -301,13 +301,13 @@ var/Li=1 var/Ri=1 var/list/result = new() - while(Li <= L.len && Ri <= R.len) + while(Li <= length(L) && Ri <= length(R)) if(sorttext(L[Li], R[Ri]) < 1) result += R[Ri++] else result += L[Li++] - if(Li <= L.len) + if(Li <= length(L)) return (result + L.Copy(Li, 0)) return (result + R.Copy(Ri, 0)) @@ -322,68 +322,68 @@ // List of lists, sorts by element[key] - for things like crew monitoring computer sorting records by name. /proc/sortByKey(list/L, key) - if(L.len < 2) + if(length(L) < 2) return L - var/middle = L.len / 2 + 1 + var/middle = length(L) / 2 + 1 return mergeKeyedLists(sortByKey(L.Copy(0, middle), key), sortByKey(L.Copy(middle), key), key) /proc/mergeKeyedLists(list/L, list/R, key) var/Li=1 var/Ri=1 var/list/result = new() - while(Li <= L.len && Ri <= R.len) + while(Li <= length(L) && Ri <= length(R)) if(sorttext(L[Li][key], R[Ri][key]) < 1) // Works around list += list2 merging lists; it's not pretty but it works result += "temp item" - result[result.len] = R[Ri++] + result[length(result)] = R[Ri++] else result += "temp item" - result[result.len] = L[Li++] + result[length(result)] = L[Li++] - if(Li <= L.len) + if(Li <= length(L)) return (result + L.Copy(Li, 0)) return (result + R.Copy(Ri, 0)) //Mergesort: any value in a list, preserves key=value structure /proc/sortAssoc(list/L) - if(L.len < 2) + if(length(L) < 2) return L - var/middle = L.len / 2 + 1 // Copy is first,second-1 + var/middle = length(L) / 2 + 1 // Copy is first,second-1 return mergeAssoc(sortAssoc(L.Copy(0,middle)), sortAssoc(L.Copy(middle))) //second parameter null = to end of list /proc/mergeAssoc(list/L, list/R) var/Li=1 var/Ri=1 var/list/result = new() - while(Li <= L.len && Ri <= R.len) + while(Li <= length(L) && Ri <= length(R)) if(sorttext(L[Li], R[Ri]) < 1) result += R&R[Ri++] else result += L&L[Li++] - if(Li <= L.len) + if(Li <= length(L)) return (result + L.Copy(Li, 0)) return (result + R.Copy(Ri, 0)) // Same as sortAssoc but rather than creating a whole new list keeps the original list ref and just returns that list modified /proc/sortAssocKeepList(list/L) - if(L.len < 2) + if(length(L) < 2) return L - var/middle = L.len / 2 + 1 // Copy is first,second-1 + var/middle = length(L) / 2 + 1 // Copy is first,second-1 return mergeAssocKeepList(sortAssoc(L.Copy(0,middle)), sortAssoc(L.Copy(middle)), L) //second parameter null = to end of list /proc/mergeAssocKeepList(list/L, list/R, list/original) var/Li=1 var/Ri=1 var/list/result = new() - while(Li <= L.len && Ri <= R.len) + while(Li <= length(L) && Ri <= length(R)) if(sorttext(L[Li], R[Ri]) < 1) result += R&R[Ri++] else result += L&L[Li++] - if(Li <= L.len) + if(Li <= length(L)) result += L.Copy(Li, 0) else result += R.Copy(Ri, 0) @@ -408,7 +408,7 @@ /proc/bitfield2list(bitfield = 0, list/wordlist) var/list/r = list() if(islist(wordlist)) - var/max = min(wordlist.len,16) + var/max = min(length(wordlist),16) var/bit = 1 for(var/i=1, i<=max, i++) if(bitfield & bit) @@ -430,9 +430,9 @@ //Move a single element from position fromIndex within a list, to position toIndex //All elements in the range [1,toIndex) before the move will be before the pivot afterwards -//All elements in the range [toIndex, L.len+1) before the move will be after the pivot afterwards +//All elements in the range [toIndex, length(L)+1) before the move will be after the pivot afterwards //In other words, it's as if the range [fromIndex,toIndex) have been rotated using a <<< operation common to other languages. -//fromIndex and toIndex must be in the range [1,L.len+1] +//fromIndex and toIndex must be in the range [1,length(L)+1] //This will preserve associations ~Carnie /proc/moveElement(list/L, fromIndex, toIndex) if(fromIndex == toIndex || fromIndex+1 == toIndex) //no need to move @@ -493,13 +493,13 @@ //replaces reverseList ~Carnie /proc/reverseRange(list/L, start=1, end=0) - if(L.len) - start = start % L.len - end = end % (L.len+1) + if(length(L)) + start = start % length(L) + end = end % (length(L)+1) if(start <= 0) - start += L.len + start += length(L) if(end <= 0) - end += L.len + 1 + end += length(L) + 1 --end while(start < end) @@ -518,13 +518,13 @@ ///replaces reverseList ~Carnie /proc/reverse_range(list/inserted_list, start = 1, end = 0) - if(inserted_list.len) - start = start % inserted_list.len - end = end % (inserted_list.len + 1) + if(length(inserted_list)) + start = start % length(inserted_list) + end = end % (length(inserted_list) + 1) if(start <= 0) - start += inserted_list.len + start += length(inserted_list) if(end <= 0) - end += inserted_list.len + 1 + end += length(inserted_list) + 1 --end while(start < end) @@ -574,7 +574,7 @@ var/list/found = list() for(var/atom/A in contents) found += A - if(A.contents.len) + if(length(A.contents)) found += A.contents_recursive() return found @@ -582,7 +582,7 @@ var/list/found = list() for(var/atom/A in contents) found += A - if(A.contents.len) + if(length(A.contents)) found += A.contents return found @@ -594,15 +594,15 @@ if(!sort) return L - if(L.len <= 1) + if(length(L) <= 1) return L - var/middle = floor(L.len / 2) + var/middle = floor(length(L) / 2) var/list/left = custom_mergesort(L.Copy(1, middle + 1)) var/list/right = custom_mergesort(L.Copy(middle + 1)) var/list/result = list() - while(left.len > 0 && right.len > 0) + while(length(left) > 0 && length(right) > 0) var/a = left[1] var/b = right[1] @@ -613,11 +613,11 @@ result += b right.Cut(1,2) - while(left.len > 0) + while(length(left) > 0) result += left[1] left.Cut(1,2) - while(right.len > 0) + while(length(right) > 0) result += right[1] right.Cut(1,2) diff --git a/code/__HELPERS/mobs.dm b/code/__HELPERS/mobs.dm index b5bf7a02d026..1d123b3a8e00 100644 --- a/code/__HELPERS/mobs.dm +++ b/code/__HELPERS/mobs.dm @@ -26,7 +26,7 @@ continue valid_hairstyles[hairstyle] = GLOB.hair_styles_list[hairstyle] - if(valid_hairstyles.len) + if(length(valid_hairstyles)) h_style = pick(valid_hairstyles) return h_style @@ -48,7 +48,7 @@ continue valid_facialhairstyles[facialhairstyle] = GLOB.facial_hair_styles_list[facialhairstyle] - if(valid_facialhairstyles.len) + if(length(valid_facialhairstyles)) f_style = pick(valid_facialhairstyles) return f_style diff --git a/code/__HELPERS/sanitize_values.dm b/code/__HELPERS/sanitize_values.dm index eddb326568c0..291246e621a0 100644 --- a/code/__HELPERS/sanitize_values.dm +++ b/code/__HELPERS/sanitize_values.dm @@ -20,7 +20,7 @@ /proc/sanitize_inlist(value, list/List, default) if(value in List) return value if(default) return default - if(List && List.len)return List[1] + if(LAZYLEN(List))return List[1] /proc/sanitize_list(list/List, list/filter = list(null), default = list()) if(!islist(List)) diff --git a/code/__HELPERS/shell.dm b/code/__HELPERS/shell.dm index 35a8e4635b41..a165a7981fe8 100644 --- a/code/__HELPERS/shell.dm +++ b/code/__HELPERS/shell.dm @@ -20,7 +20,7 @@ shelleo_id = "[seo_id]" break if(!shelleo_id) - shelleo_id = "[shelleo_ids.len + 1]" + shelleo_id = "[length(shelleo_ids) + 1]" shelleo_ids += shelleo_id shelleo_ids[shelleo_id] = TRUE out_file = "[SHELLEO_NAME][shelleo_id][SHELLEO_OUT]" diff --git a/code/__HELPERS/sorts/TimSort.dm b/code/__HELPERS/sorts/TimSort.dm index ae83bd9b0682..89a93802edee 100644 --- a/code/__HELPERS/sorts/TimSort.dm +++ b/code/__HELPERS/sorts/TimSort.dm @@ -1,12 +1,12 @@ //TimSort interface /proc/sortTim(list/L, cmp=/proc/cmp_numeric_asc, associative, fromIndex=1, toIndex=0) - if(L && L.len >= 2) - fromIndex = fromIndex % L.len - toIndex = toIndex % (L.len+1) + if(length(L) >= 2) + fromIndex = fromIndex % length(L) + toIndex = toIndex % (length(L)+1) if(fromIndex <= 0) - fromIndex += L.len + fromIndex += length(L) if(toIndex <= 0) - toIndex += L.len + 1 + toIndex += length(L) + 1 var/datum/sortInstance/sort_instance = GLOB.sortInstance if(!sort_instance) diff --git a/code/__HELPERS/sorts/_Main.dm b/code/__HELPERS/sorts/_Main.dm index 7fe3adf02870..4caf2c4c068e 100644 --- a/code/__HELPERS/sorts/_Main.dm +++ b/code/__HELPERS/sorts/_Main.dm @@ -76,7 +76,7 @@ GLOBAL_DATUM_INIT(sortInstance, /datum/sortInstance, new()) //Merge all remaining runs to complete sort //ASSERT(start == end) mergeForceCollapse(); - //ASSERT(runBases.len == 1) + //ASSERT(length(runBases) == 1) //reset minGallop, for successive calls minGallop = MIN_GALLOP @@ -178,8 +178,8 @@ GLOBAL_DATUM_INIT(sortInstance, /datum/sortInstance, new()) //This method is called each time a new run is pushed onto the stack. //So the invariants are guaranteed to hold for i= 2) - var/n = runBases.len - 1 + while(length(runBases) >= 2) + var/n = length(runBases) - 1 if(n > 1 && runLens[n-1] <= runLens[n] + runLens[n+1]) if(runLens[n-1] < runLens[n+1]) --n @@ -193,8 +193,8 @@ GLOBAL_DATUM_INIT(sortInstance, /datum/sortInstance, new()) //Merges all runs on the stack until only one remains. //Called only once, to finalise the sort /datum/sortInstance/proc/mergeForceCollapse() - while(runBases.len >= 2) - var/n = runBases.len - 1 + while(length(runBases) >= 2) + var/n = length(runBases) - 1 if(n > 1 && runLens[n-1] < runLens[n+1]) --n mergeAt(n) @@ -204,9 +204,9 @@ GLOBAL_DATUM_INIT(sortInstance, /datum/sortInstance, new()) //Run i must be the penultimate or antepenultimate run on the stack //In other words, i must be equal to stackSize-2 or stackSize-3 /datum/sortInstance/proc/mergeAt(i) - //ASSERT(runBases.len >= 2) + //ASSERT(length(runBases) >= 2) //ASSERT(i >= 1) - //ASSERT(i == runBases.len - 1 || i == runBases.len - 2) + //ASSERT(i == length(runBases) - 1 || i == length(runBases) - 2) var/base1 = runBases[i] var/base2 = runBases[i+1] @@ -596,8 +596,8 @@ GLOBAL_DATUM_INIT(sortInstance, /datum/sortInstance, new()) while(remaining > 0) - while(runBases.len >= 2) - var/n = runBases.len - 1 + while(length(runBases) >= 2) + var/n = length(runBases) - 1 if(n > 1 && runLens[n-1] <= runLens[n] + runLens[n+1]) if(runLens[n-1] < runLens[n+1]) --n @@ -607,8 +607,8 @@ GLOBAL_DATUM_INIT(sortInstance, /datum/sortInstance, new()) else break //Invariant is established - while(runBases.len >= 2) - var/n = runBases.len - 1 + while(length(runBases) >= 2) + var/n = length(runBases) - 1 if(n > 1 && runLens[n-1] < runLens[n+1]) --n mergeAt2(n) diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index 5b9154eac655..d8eebf79bca6 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -534,7 +534,7 @@ /atom/proc/GetAllContents(searchDepth = 5, list/toReturn = list()) for(var/atom/part as anything in contents) toReturn += part - if(part.contents.len && searchDepth) + if(length(part.contents) && searchDepth) part.GetAllContents(searchDepth - 1, toReturn) return toReturn @@ -555,7 +555,7 @@ if(part.loc != src) // That's a multitile atom, and it's not actually here stricto sensu continue toReturn += part - if(part.contents.len && searchDepth) + if(length(part.contents) && searchDepth) part.GetAllContents(searchDepth - 1, toReturn) return toReturn @@ -1082,7 +1082,7 @@ GLOBAL_DATUM(action_purple_power_up, /image) var/list/doors = new/list() - if(toupdate.len) + if(length(toupdate)) for(var/turf/T1 in toupdate) for(var/obj/structure/machinery/door/D2 in T1) doors += D2 @@ -1091,7 +1091,7 @@ GLOBAL_DATUM(action_purple_power_up, /image) else air_master.tiles_to_update += T1*/ - if(fromupdate.len) + if(length(fromupdate)) for(var/turf/T2 in fromupdate) for(var/obj/structure/machinery/door/D2 in T2) doors += D2 @@ -1287,7 +1287,7 @@ GLOBAL_LIST_INIT(WALLITEMS, list( for(var/turf/T in orange(origin, outer_range)) if(!inner_range || get_dist(origin, T) >= inner_range) turfs += T - if(turfs.len) + if(length(turfs)) return pick(turfs) // Returns true if arming a given explosive might be considered grief @@ -1531,7 +1531,7 @@ GLOBAL_DATUM_INIT(dview_mob, /mob/dview, new) return GetAllContents() var/list/processing = list(src) var/list/assembled = list() - while(processing.len) + while(length(processing)) var/atom/A = processing[1] processing.Cut(1,2) if(!ignore_typecache[A.type]) diff --git a/code/_globalvars/global_lists.dm b/code/_globalvars/global_lists.dm index e663bc287946..c054b9a4bf1f 100644 --- a/code/_globalvars/global_lists.dm +++ b/code/_globalvars/global_lists.dm @@ -303,7 +303,7 @@ GLOBAL_LIST_INIT(hj_emotes, setup_hazard_joe_emotes()) /proc/number_list_decode(number_list_data) var/list/L = params2list(number_list_data) - for(var/i in 1 to L.len) + for(var/i in 1 to length(L)) L[i] = text2num(L[i]) return L diff --git a/code/_macros.dm b/code/_macros.dm index 075d098e3d50..abfa83df7d36 100644 --- a/code/_macros.dm +++ b/code/_macros.dm @@ -74,7 +74,7 @@ lazy_list[key] |= value; // Insert an object A into a sorted list using cmp_proc (/code/_helpers/cmp.dm) for comparison. -#define ADD_SORTED(list, A, cmp_proc) if(!list.len) {list.Add(A)} else {list.Insert(FindElementIndex(A, list, cmp_proc), A)} +#define ADD_SORTED(list, A, cmp_proc) if(!length(list)) {list.Add(A)} else {list.Insert(FindElementIndex(A, list, cmp_proc), A)} //Currently used in SDQL2 stuff #define send_output(target, msg, control) target << output(msg, control) diff --git a/code/_onclick/adjacent.dm b/code/_onclick/adjacent.dm index 678c5373fe67..af0882d6a9df 100644 --- a/code/_onclick/adjacent.dm +++ b/code/_onclick/adjacent.dm @@ -262,10 +262,10 @@ Quick adjacency (to turf): // Make sure pass flags are removed A.remove_temp_pass_flags(pass_flags) - if ((fd1 && !blockers["fd1"].len) || (fd2 && !blockers["fd2"].len)) // This means that for a given direction it did not have a blocker + if ((fd1 && !length(blockers["fd1"])) || (fd2 && !length(blockers["fd2"]))) // This means that for a given direction it did not have a blocker return src - if (blockers["fd1"].len || blockers["fd2"].len) + if (length(blockers["fd1"]) || length(blockers["fd2"])) var/guaranteed_hit = 0 // indicates whether there is a guaranteed hit (aka there is not chance to bypass blocker). 0 = nothing var/list/cur_dense_blockers = list() for (var/atom/blocker in blockers["fd1"]) diff --git a/code/_onclick/click.dm b/code/_onclick/click.dm index 57c529c7a156..a5d07ec060cb 100644 --- a/code/_onclick/click.dm +++ b/code/_onclick/click.dm @@ -199,7 +199,7 @@ if (mods["alt"]) var/turf/T = get_turf(src) - if(T && user.TurfAdjacent(T) && T.contents.len) + if(T && user.TurfAdjacent(T) && length(T.contents)) user.set_listed_turf(T) return TRUE diff --git a/code/_onclick/click_hold.dm b/code/_onclick/click_hold.dm index 41e2be147d85..1d6c25619e5e 100644 --- a/code/_onclick/click_hold.dm +++ b/code/_onclick/click_hold.dm @@ -88,7 +88,7 @@ if(mods["left"]) SEND_SIGNAL(src, COMSIG_CLIENT_LMB_DRAG, src_obj, over_obj, params) - var/atom/last_atom = LAZYACCESS(mouse_trace_history, mouse_trace_history.len) + var/atom/last_atom = LAZYACCESS(mouse_trace_history, length(mouse_trace_history)) if(over_obj == last_atom) return diff --git a/code/_onclick/hud/hud.dm b/code/_onclick/hud/hud.dm index 7277c74b2fd3..2d49abb52012 100644 --- a/code/_onclick/hud/hud.dm +++ b/code/_onclick/hud/hud.dm @@ -91,19 +91,19 @@ /datum/hud/Destroy() if(mymob.hud_used == src) mymob.hud_used = null - if(static_inventory.len) + if(length(static_inventory)) for(var/thing in static_inventory) qdel(thing) static_inventory.Cut() - if(toggleable_inventory.len) + if(length(toggleable_inventory)) for(var/thing in toggleable_inventory) qdel(thing) toggleable_inventory.Cut() - if(hotkeybuttons.len) + if(length(hotkeybuttons)) for(var/thing in hotkeybuttons) qdel(thing) hotkeybuttons.Cut() - if(infodisplay.len) + if(length(infodisplay)) for(var/thing in infodisplay) qdel(thing) infodisplay.Cut() @@ -188,24 +188,24 @@ switch(display_hud_version) if(HUD_STYLE_STANDARD) //Default HUD hud_shown = 1 //Governs behavior of other procs - if(static_inventory.len) + if(length(static_inventory)) screenmob.client.add_to_screen(static_inventory) - if(toggleable_inventory.len && inventory_shown) + if(length(toggleable_inventory) && inventory_shown) screenmob.client.add_to_screen(toggleable_inventory) - if(hotkeybuttons.len && !hotkey_ui_hidden) + if(length(hotkeybuttons) && !hotkey_ui_hidden) screenmob.client.add_to_screen(hotkeybuttons) - if(infodisplay.len) + if(length(infodisplay)) screenmob.client.add_to_screen(infodisplay) if(HUD_STYLE_REDUCED) //Reduced HUD hud_shown = 0 //Governs behavior of other procs - if(static_inventory.len) + if(length(static_inventory)) screenmob.client.remove_from_screen(static_inventory) - if(toggleable_inventory.len) + if(length(toggleable_inventory)) screenmob.client.remove_from_screen(toggleable_inventory) - if(hotkeybuttons.len) + if(length(hotkeybuttons)) screenmob.client.remove_from_screen(hotkeybuttons) - if(infodisplay.len) + if(length(infodisplay)) screenmob.client.add_to_screen(infodisplay) //These ones are a part of 'static_inventory', 'toggleable_inventory' or 'hotkeybuttons' but we want them to stay @@ -218,13 +218,13 @@ if(HUD_STYLE_NOHUD) //No HUD hud_shown = 0 //Governs behavior of other procs - if(static_inventory.len) + if(length(static_inventory)) screenmob.client.remove_from_screen(static_inventory) - if(toggleable_inventory.len) + if(length(toggleable_inventory)) screenmob.client.remove_from_screen(toggleable_inventory) - if(hotkeybuttons.len) + if(length(hotkeybuttons)) screenmob.client.remove_from_screen(hotkeybuttons) - if(infodisplay.len) + if(length(infodisplay)) screenmob.client.remove_from_screen(infodisplay) hud_version = display_hud_version diff --git a/code/_onclick/hud/human.dm b/code/_onclick/hud/human.dm index b8b55b42c028..bbdfaa25b92f 100644 --- a/code/_onclick/hud/human.dm +++ b/code/_onclick/hud/human.dm @@ -120,7 +120,7 @@ if(!screenmob?.client) return - if(!gear.len) + if(!length(gear)) inventory_shown = FALSE return //species without inv slots don't show items. diff --git a/code/_onclick/hud/radial.dm b/code/_onclick/hud/radial.dm index 2886b2edb0ee..244e79e583f6 100644 --- a/code/_onclick/hud/radial.dm +++ b/code/_onclick/hud/radial.dm @@ -143,9 +143,9 @@ GLOBAL_LIST_EMPTY(radial_menus) zone = 360 - starting_angle + ending_angle max_elements = floor(zone / min_angle) - var/paged = max_elements < choices.len - if(elements.len < max_elements) - var/elements_to_add = max_elements - elements.len + var/paged = max_elements < length(choices) + if(length(elements) < max_elements) + var/elements_to_add = max_elements - length(elements) for(var/i in 1 to elements_to_add) //Create all elements var/atom/movable/screen/radial/slice/new_element = new /atom/movable/screen/radial/slice new_element.tooltips = use_tooltips @@ -246,7 +246,7 @@ GLOBAL_LIST_EMPTY(radial_menus) selected_choice = choices_values[choice_id] /datum/radial_menu/proc/get_next_id() - return "c_[choices.len]" + return "c_[length(choices)]" /datum/radial_menu/proc/set_choices(list/new_choices, use_tooltips, use_labels) if(length(choices)) diff --git a/code/_onclick/hud/screen_objects.dm b/code/_onclick/hud/screen_objects.dm index 8508352bb338..a8162911804b 100644 --- a/code/_onclick/hud/screen_objects.dm +++ b/code/_onclick/hud/screen_objects.dm @@ -119,7 +119,7 @@ layer = HUD_LAYER /atom/movable/screen/storage/proc/update_fullness(obj/item/storage/master_storage) - if(!master_storage.contents.len) + if(!length(master_storage.contents)) color = null else var/total_w = 0 @@ -131,7 +131,7 @@ if (master_storage.storage_slots == null) fullness = floor(10*total_w/master_storage.max_storage_space) else - fullness = floor(10*master_storage.contents.len/master_storage.storage_slots) + fullness = floor(10*length(master_storage.contents)/master_storage.storage_slots) switch(fullness) if(10) color = "#ff0000" diff --git a/code/_onclick/item_attack.dm b/code/_onclick/item_attack.dm index ffcab30234ae..1a3c279db8b3 100644 --- a/code/_onclick/item_attack.dm +++ b/code/_onclick/item_attack.dm @@ -90,7 +90,7 @@ power = floor(power * (1 + 0.25 * user.skills.get_skill_level(SKILL_MELEE_WEAPONS))) //25% bonus per melee level if(!ishuman(M)) var/used_verb = "attacked" - if(attack_verb && attack_verb.len) + if(LAZYLEN(attack_verb)) used_verb = pick(attack_verb) user.visible_message(SPAN_DANGER("[M] has been [used_verb] with [src][showname]."), \ SPAN_DANGER("You [used_verb] [M == user ? "yourself":M] with [src]."), null, 5, CHAT_TYPE_MELEE_HIT) diff --git a/code/_onclick/ventcrawl.dm b/code/_onclick/ventcrawl.dm index e1877dcbd0a7..72fe31f35cdc 100644 --- a/code/_onclick/ventcrawl.dm +++ b/code/_onclick/ventcrawl.dm @@ -24,10 +24,10 @@ for(var/obj/structure/pipes/vents/V in range(1)) if(Adjacent(V) && !V.welded) pipes |= V - if(!pipes || !pipes.len) + if(!LAZYLEN(pipes)) to_chat(src, SPAN_WARNING("There are no pipes that we can ventcrawl into within range!")) return - if(pipes.len == 1) + if(length(pipes) == 1) pipe = pipes[1] else pipe = tgui_input_list(usr, "Crawl Through Vent", "Pick a pipe", pipes) diff --git a/code/controllers/configuration/config_entry.dm b/code/controllers/configuration/config_entry.dm index 657e7470fc54..49dae4c2ff38 100644 --- a/code/controllers/configuration/config_entry.dm +++ b/code/controllers/configuration/config_entry.dm @@ -125,7 +125,7 @@ if(isnull(temp)) return FALSE new_list += temp - if(!new_list.len) + if(!length(new_list)) return FALSE config_entry_value = new_list return TRUE diff --git a/code/controllers/configuration/configuration.dm b/code/controllers/configuration/configuration.dm index 147f57fcb1aa..7207f878614a 100644 --- a/code/controllers/configuration/configuration.dm +++ b/code/controllers/configuration/configuration.dm @@ -329,7 +329,7 @@ continue in_character_filter += REGEX_QUOTE(line) - ic_filter_regex = in_character_filter.len ? regex("\\b([jointext(in_character_filter, "|")])\\b", "i") : null + ic_filter_regex = length(in_character_filter) ? regex("\\b([jointext(in_character_filter, "|")])\\b", "i") : null //Message admins when you can. /datum/controller/configuration/proc/DelayedMessageAdmins(text) diff --git a/code/controllers/mc/globals.dm b/code/controllers/mc/globals.dm index 724f58010699..59b96c017d10 100644 --- a/code/controllers/mc/globals.dm +++ b/code/controllers/mc/globals.dm @@ -20,7 +20,7 @@ GLOBAL_REAL(GLOB, /datum/controller/global_vars) QDEL_IN(exclude_these, 0) //signal logging isn't ready - log_world("[vars.len - gvars_datum_in_built_vars.len] global variables") + log_world("[length(vars) - length(gvars_datum_in_built_vars)] global variables") Initialize() @@ -42,10 +42,10 @@ GLOBAL_REAL(GLOB, /datum/controller/global_vars) gvars_datum_init_order = list() gvars_datum_protected_varlist = list(NAMEOF(src, gvars_datum_protected_varlist) = TRUE) var/list/global_procs = typesof(/datum/controller/global_vars/proc) - var/expected_len = vars.len - gvars_datum_in_built_vars.len - if(global_procs.len != expected_len) - warning("Unable to detect all global initialization procs! Expected [expected_len] got [global_procs.len]!") - if(global_procs.len) + var/expected_len = length(vars) - length(gvars_datum_in_built_vars) + if(length(global_procs) != expected_len) + warning("Unable to detect all global initialization procs! Expected [expected_len] got [length(global_procs)]!") + if(length(global_procs)) var/list/expected_global_procs = vars - gvars_datum_in_built_vars for(var/I in global_procs) expected_global_procs -= replacetext("[I]", "InitGlobal", "") diff --git a/code/controllers/mc/master.dm b/code/controllers/mc/master.dm index edfda35a1e75..31460bf4e9c5 100644 --- a/code/controllers/mc/master.dm +++ b/code/controllers/mc/master.dm @@ -415,9 +415,9 @@ GLOBAL_REAL(Master, /datum/controller/master) = new var/ss_runlevels = SS.runlevels var/added_to_any = FALSE - for(var/I in 1 to GLOB.bitflags.len) + for(var/I in 1 to length(GLOB.bitflags)) if(ss_runlevels & GLOB.bitflags[I]) - while(runlevel_sorted_subsystems.len < I) + while(length(runlevel_sorted_subsystems) < I) runlevel_sorted_subsystems += list(list()) runlevel_sorted_subsystems[I] += SS added_to_any = TRUE diff --git a/code/controllers/shuttle_controller.dm b/code/controllers/shuttle_controller.dm index 35031cf7334f..fb0cb1ff7637 100644 --- a/code/controllers/shuttle_controller.dm +++ b/code/controllers/shuttle_controller.dm @@ -215,7 +215,7 @@ dock_controller_map[shuttle.docking_controller_tag] = shuttle //search for the controllers, if we have one. - if(dock_controller_map.len) + if(length(dock_controller_map)) for(var/obj/structure/machinery/embedded_controller/radio/C in GLOB.machines) //only radio controllers are supported at the moment if (istype(C.program, /datum/computer/file/embedded_program/docking)) if(dock_controller_map[C.id_tag]) @@ -226,7 +226,7 @@ //sanity check //NO SANITY -// if (dock_controller_map.len || dock_controller_map_station.len || dock_controller_map_offsite.len) +// if (length(dock_controller_map) || length(dock_controller_map_station) || length(dock_controller_map_offsite)) // var/dat = "" // for (var/dock_tag in dock_controller_map + dock_controller_map_station + dock_controller_map_offsite) // dat += "\"[dock_tag]\", " diff --git a/code/controllers/subsystem/acid_pillar.dm b/code/controllers/subsystem/acid_pillar.dm index aaa38834667f..70994e641503 100644 --- a/code/controllers/subsystem/acid_pillar.dm +++ b/code/controllers/subsystem/acid_pillar.dm @@ -11,8 +11,8 @@ SUBSYSTEM_DEF(acid_pillar) if (!resumed) currentrun = queuedrun.Copy() - while (currentrun.len) - var/hash = currentrun[currentrun.len] + while (length(currentrun)) + var/hash = currentrun[length(currentrun)] var/datum/acid_spray_info/data = currentrun[hash] currentrun.len-- diff --git a/code/controllers/subsystem/atoms.dm b/code/controllers/subsystem/atoms.dm index f0d5ee14363e..dbe2f1a39c6b 100644 --- a/code/controllers/subsystem/atoms.dm +++ b/code/controllers/subsystem/atoms.dm @@ -62,7 +62,7 @@ SUBSYSTEM_DEF(atoms) processing_late_loaders = TRUE - for(var/I = 1; I <= late_loaders.len; I++) + for(var/I = 1; I <= length(late_loaders); I++) var/atom/A = late_loaders[I] //I hate that we need this if(QDELETED(A)) @@ -70,7 +70,7 @@ SUBSYSTEM_DEF(atoms) A.LateInitialize() #ifdef TESTING - testing("Late initialized [late_loaders.len] atoms") + testing("Late initialized [length(late_loaders)] atoms") #endif late_loaders.Cut() processing_late_loaders = FALSE @@ -87,10 +87,10 @@ SUBSYSTEM_DEF(atoms) var/list/mapload_arg = list(TRUE) if(atoms) #ifdef TESTING - count = atoms.len + count = length(atoms) #endif - for(var/I in 1 to atoms.len) + for(var/I in 1 to length(atoms)) var/atom/A = atoms[I] if(!(A.flags_atom & INITIALIZED)) CHECK_TICK diff --git a/code/controllers/subsystem/cellauto.dm b/code/controllers/subsystem/cellauto.dm index b543ddd43c26..983d168d61a1 100644 --- a/code/controllers/subsystem/cellauto.dm +++ b/code/controllers/subsystem/cellauto.dm @@ -9,15 +9,15 @@ SUBSYSTEM_DEF(cellauto) var/list/currentrun = list() /datum/controller/subsystem/cellauto/stat_entry(msg) - msg = "C: [GLOB.cellauto_cells.len]" + msg = "C: [length(GLOB.cellauto_cells)]" return ..() /datum/controller/subsystem/cellauto/fire(resumed = FALSE) if (!resumed) currentrun = GLOB.cellauto_cells.Copy() - while(currentrun.len) - var/datum/automata_cell/C = currentrun[currentrun.len] + while(length(currentrun)) + var/datum/automata_cell/C = currentrun[length(currentrun)] currentrun.len-- if (!C || QDELETED(C)) diff --git a/code/controllers/subsystem/decorator.dm b/code/controllers/subsystem/decorator.dm index 6194b05d561b..ac63fca47ac5 100644 --- a/code/controllers/subsystem/decorator.dm +++ b/code/controllers/subsystem/decorator.dm @@ -35,7 +35,7 @@ SUBSYSTEM_DEF(decorator) if(!decor.is_active_decor()) continue var/list/applicable_types = decor.get_decor_types() - if(!applicable_types || !applicable_types.len) + if(!LAZYLEN(applicable_types)) continue active_decorators |= decor for(var/app_type in applicable_types) @@ -64,7 +64,7 @@ SUBSYSTEM_DEF(decorator) currentrun = swap while(length(currentrun)) - var/datum/weakref/ref = currentrun[currentrun.len] + var/datum/weakref/ref = currentrun[length(currentrun)] currentrun.len-- var/atom/A = ref?.resolve() if(A) A.Decorate(deferable = FALSE) @@ -80,7 +80,7 @@ SUBSYSTEM_DEF(decorator) // DECORATOR IS ENABLED FORCEFULLY var/list/applicable_types = decor.get_decor_types() - if(!applicable_types || !applicable_types.len) + if(!LAZYLEN(applicable_types)) return active_decorators |= decor for(var/app_type in applicable_types) @@ -100,7 +100,7 @@ SUBSYSTEM_DEF(decorator) /datum/controller/subsystem/decorator/stat_entry(msg) if(registered_decorators && decoratable) - msg = "D:[registered_decorators.len],P:[decoratable.len]" + msg = "D:[length(registered_decorators)],P:[length(decoratable)]" return ..() /datum/controller/subsystem/decorator/proc/decorate(atom/o) @@ -118,25 +118,25 @@ SUBSYSTEM_DEF(decorator) /datum/controller/subsystem/decorator/proc/sortDecorators(list/datum/decorator/L) if(!istype(L)) return null - if(L.len < 2) + if(length(L) < 2) return L - var/middle = L.len / 2 + 1 + var/middle = length(L) / 2 + 1 return mergeDecoratorLists(sortDecorators(L.Copy(0, middle)), sortDecorators(L.Copy(middle))) /datum/controller/subsystem/decorator/proc/mergeDecoratorLists(list/datum/decorator/L, list/datum/decorator/R) var/Li=1 var/Ri=1 var/list/result = new() - while(Li <= L.len && Ri <= R.len) + while(Li <= length(L) && Ri <= length(R)) if(sorttext(L[Li].priority, R[Ri].priority) < 1) // Works around list += list2 merging lists; it's not pretty but it works result += "temp item" - result[result.len] = R[Ri++] + result[length(result)] = R[Ri++] else result += "temp item" - result[result.len] = L[Li++] + result[length(result)] = L[Li++] - if(Li <= L.len) + if(Li <= length(L)) return (result + L.Copy(Li, 0)) return (result + R.Copy(Ri, 0)) diff --git a/code/controllers/subsystem/disease.dm b/code/controllers/subsystem/disease.dm index b98187ca252c..342a6b28906b 100644 --- a/code/controllers/subsystem/disease.dm +++ b/code/controllers/subsystem/disease.dm @@ -8,15 +8,15 @@ SUBSYSTEM_DEF(disease) var/list/datum/disease/currentrun = list() /datum/controller/subsystem/disease/stat_entry(msg) - msg = "P:[all_diseases.len]" + msg = "P:[length(all_diseases)]" return ..() /datum/controller/subsystem/disease/fire(resumed = FALSE) if (!resumed) currentrun = all_diseases.Copy() - while (currentrun.len) - var/datum/disease/D = currentrun[currentrun.len] + while (length(currentrun)) + var/datum/disease/D = currentrun[length(currentrun)] currentrun.len-- if (!D || QDELETED(D)) diff --git a/code/controllers/subsystem/events.dm b/code/controllers/subsystem/events.dm index f4dd544784f0..db1b07475489 100644 --- a/code/controllers/subsystem/events.dm +++ b/code/controllers/subsystem/events.dm @@ -35,8 +35,8 @@ SUBSYSTEM_DEF(events) //cache for sanic speed (lists are references anyways) var/list/currentrun = src.currentrun - while(currentrun.len) - var/datum/thing = currentrun[currentrun.len] + while(length(currentrun)) + var/datum/thing = currentrun[length(currentrun)] currentrun.len-- if(thing) thing.process() diff --git a/code/controllers/subsystem/fz_transitions.dm b/code/controllers/subsystem/fz_transitions.dm index d12ab1358535..5a6db625145c 100644 --- a/code/controllers/subsystem/fz_transitions.dm +++ b/code/controllers/subsystem/fz_transitions.dm @@ -10,7 +10,7 @@ SUBSYSTEM_DEF(fz_transitions) flags = SS_KEEP_TIMING /datum/controller/subsystem/fz_transitions/stat_entry(msg) - msg = "P:[GLOB.projectors.len]|C:[GLOB.clones.len]|T:[GLOB.clones_t.len]" + msg = "P:[length(GLOB.projectors)]|C:[length(GLOB.clones)]|T:[length(GLOB.clones_t)]" return ..() /datum/controller/subsystem/fz_transitions/Initialize() diff --git a/code/controllers/subsystem/garbage.dm b/code/controllers/subsystem/garbage.dm index 37c305d59cde..072419df2cbd 100644 --- a/code/controllers/subsystem/garbage.dm +++ b/code/controllers/subsystem/garbage.dm @@ -297,7 +297,7 @@ SUBSYSTEM_DEF(garbage) /datum/controller/subsystem/garbage/Recover() InitQueues() //We first need to create the queues before recovering data if (istype(SSgarbage.queues)) - for (var/i in 1 to SSgarbage.queues.len) + for (var/i in 1 to length(SSgarbage.queues)) queues[i] |= SSgarbage.queues[i] /// Qdel Item: Holds statistics on each type that passes thru qdel diff --git a/code/controllers/subsystem/human.dm b/code/controllers/subsystem/human.dm index ffbbb7aa9240..3bc67c48a2be 100644 --- a/code/controllers/subsystem/human.dm +++ b/code/controllers/subsystem/human.dm @@ -10,15 +10,15 @@ SUBSYSTEM_DEF(human) /datum/controller/subsystem/human/stat_entry(msg) - msg = "P:[processable_human_list.len]" + msg = "P:[length(processable_human_list)]" return ..() /datum/controller/subsystem/human/fire(resumed = FALSE) if (!resumed) currentrun = processable_human_list.Copy() - while (currentrun.len) - var/mob/living/carbon/human/M = currentrun[currentrun.len] + while (length(currentrun)) + var/mob/living/carbon/human/M = currentrun[length(currentrun)] currentrun.len-- if (!M || QDELETED(M)) diff --git a/code/controllers/subsystem/init/landmarks.dm b/code/controllers/subsystem/init/landmarks.dm index 31b71c074a5d..1fdf83083833 100644 --- a/code/controllers/subsystem/init/landmarks.dm +++ b/code/controllers/subsystem/init/landmarks.dm @@ -47,14 +47,14 @@ SUBSYSTEM_DEF(landmark_init) message_admins("Item pool [pool.pool_name] has no master landmark, aborting item spawns. Tell the devs. Code: ITEM_POOL_3") continue - if (pool.quota > pool.turfs.len) - log_debug("Item pool [pool.pool_name] wants to spawn more items than it has landmarks for. Spawning [pool.turfs.len] instances of [pool.type_to_spawn] instead. Code: ITEM_POOL_4") - message_admins("Item pool [pool.pool_name] wants to spawn more items than it has landmarks for. Spawning [pool.turfs.len] instances of [pool.type_to_spawn] instead. Tell the devs. Code: ITEM_POOL_4") - pool.quota = pool.turfs.len + if (pool.quota > length(pool.turfs)) + log_debug("Item pool [pool.pool_name] wants to spawn more items than it has landmarks for. Spawning [length(pool.turfs)] instances of [pool.type_to_spawn] instead. Code: ITEM_POOL_4") + message_admins("Item pool [pool.pool_name] wants to spawn more items than it has landmarks for. Spawning [length(pool.turfs)] instances of [pool.type_to_spawn] instead. Tell the devs. Code: ITEM_POOL_4") + pool.quota = length(pool.turfs) // Quota times, pick a random turf, spawn an item there, then remove that turf from the list. for (var/i in 1 to pool.quota) - var/turf/T = pool.turfs[rand(1, pool.turfs.len)] + var/turf/T = pool.turfs[rand(1, length(pool.turfs))] var/atom/movable/newly_spawned = new pool.type_to_spawn() newly_spawned.forceMove(T) diff --git a/code/controllers/subsystem/input.dm b/code/controllers/subsystem/input.dm index 26d393d197b7..5dfd7bc5bbac 100644 --- a/code/controllers/subsystem/input.dm +++ b/code/controllers/subsystem/input.dm @@ -33,7 +33,7 @@ SUBSYSTEM_DEF(input) // Badmins just wanna have fun ♪ /datum/controller/subsystem/input/proc/refresh_client_macro_sets() var/list/clients = GLOB.clients - for(var/i in 1 to clients.len) + for(var/i in 1 to length(clients)) var/client/user = clients[i] INVOKE_ASYNC(user, /client/proc/set_macros) diff --git a/code/controllers/subsystem/item_cleanup.dm b/code/controllers/subsystem/item_cleanup.dm index 26958eb8742b..85c25e4712d3 100644 --- a/code/controllers/subsystem/item_cleanup.dm +++ b/code/controllers/subsystem/item_cleanup.dm @@ -18,9 +18,9 @@ SUBSYSTEM_DEF(item_cleanup) //Do nothing for the first 35 minutes to preserve the colony look for the first drop return - var/to_delete = items_to_clean_up.len * percentage_of_garbage_to_delete + var/to_delete = length(items_to_clean_up) * percentage_of_garbage_to_delete var/deleted = 0 - var/total_items = items_to_clean_up.len //save total before we start deleting stuff + var/total_items = length(items_to_clean_up) //save total before we start deleting stuff for (var/atom/o in items_to_clean_up) if(QDELETED(o)) items_to_clean_up -= o @@ -34,9 +34,9 @@ SUBSYSTEM_DEF(item_cleanup) break //We transfer items from the global garbage list onto the next iteration list - while(!isnull(GLOB.item_cleanup_list) && GLOB.item_cleanup_list.len > 0) - addToListNoDupe(items_to_clean_up, GLOB.item_cleanup_list[GLOB.item_cleanup_list.len]) - GLOB.item_cleanup_list -= GLOB.item_cleanup_list[GLOB.item_cleanup_list.len] + while(!isnull(GLOB.item_cleanup_list) && length(GLOB.item_cleanup_list) > 0) + addToListNoDupe(items_to_clean_up, GLOB.item_cleanup_list[length(GLOB.item_cleanup_list)]) + GLOB.item_cleanup_list -= GLOB.item_cleanup_list[length(GLOB.item_cleanup_list)] log_debug("item_cleanup deleted [deleted] garbage out of total [total_items]") diff --git a/code/controllers/subsystem/lighting.dm b/code/controllers/subsystem/lighting.dm index 3c3d14468bc2..f8c6b14e6bf7 100644 --- a/code/controllers/subsystem/lighting.dm +++ b/code/controllers/subsystem/lighting.dm @@ -27,7 +27,7 @@ SUBSYSTEM_DEF(lighting) /datum/controller/subsystem/lighting/stat_entry() - . = ..("ShCalcs:[total_shadow_calculations]|SourcQ:[static_sources_queue.len]|CcornQ:[corners_queue.len]|ObjQ:[objects_queue.len]|HybrQ:[mask_queue.len]") + . = ..("ShCalcs:[total_shadow_calculations]|SourcQ:[length(static_sources_queue)]|CcornQ:[length(corners_queue)]|ObjQ:[length(objects_queue)]|HybrQ:[length(mask_queue)]") /datum/controller/subsystem/lighting/fire(resumed, init_tick_checks) MC_SPLIT_TICK_INIT(3) diff --git a/code/controllers/subsystem/machinery.dm b/code/controllers/subsystem/machinery.dm index 6a0f938475a1..a2860615274f 100644 --- a/code/controllers/subsystem/machinery.dm +++ b/code/controllers/subsystem/machinery.dm @@ -19,15 +19,15 @@ SUBSYSTEM_DEF(machinery) return SS_INIT_SUCCESS /datum/controller/subsystem/machinery/stat_entry(msg) - msg = "M:[GLOB.processing_machines.len]" + msg = "M:[length(GLOB.processing_machines)]" return ..() /datum/controller/subsystem/machinery/fire(resumed = FALSE) if (!resumed) currentrunmachines = GLOB.processing_machines.Copy() - while (currentrunmachines.len) - var/obj/structure/machinery/M = currentrunmachines[currentrunmachines.len] + while (length(currentrunmachines)) + var/obj/structure/machinery/M = currentrunmachines[length(currentrunmachines)] currentrunmachines.len-- if (!M || QDELETED(M)) diff --git a/code/controllers/subsystem/mapping.dm b/code/controllers/subsystem/mapping.dm index f6c45453950d..0d8848217d4f 100644 --- a/code/controllers/subsystem/mapping.dm +++ b/code/controllers/subsystem/mapping.dm @@ -161,11 +161,11 @@ SUBSYSTEM_DEF(mapping) if (!length(traits)) // null or empty - default for (var/i in 1 to total_z) traits += list(default_traits) - else if (total_z != traits.len) // mismatch - INIT_ANNOUNCE("WARNING: [traits.len] trait sets specified for [total_z] z-levels in [path]!") - if (total_z < traits.len) // ignore extra traits + else if (total_z != length(traits)) // mismatch + INIT_ANNOUNCE("WARNING: [length(traits)] trait sets specified for [total_z] z-levels in [path]!") + if (total_z < length(traits)) // ignore extra traits traits.Cut(total_z + 1) - while (total_z > traits.len) // fall back to defaults on extra levels + while (total_z > length(traits)) // fall back to defaults on extra levels traits += list(default_traits) // preload the relevant space_level datums @@ -236,8 +236,8 @@ SUBSYSTEM_DEF(mapping) if(LAZYLEN(FailedZs)) //but seriously, unless the server's filesystem is messed up this will never happen var/msg = "RED ALERT! The following map files failed to load: [FailedZs[1]]" - if(FailedZs.len > 1) - for(var/I in 2 to FailedZs.len) + if(length(FailedZs) > 1) + for(var/I in 2 to length(FailedZs)) msg += ", [FailedZs[I]]" msg += ". Yell at your server host!" INIT_ANNOUNCE(msg) @@ -276,7 +276,7 @@ SUBSYSTEM_DEF(mapping) . = list() var/list/Lines = file2list(filename) - if(!Lines.len) + if(!length(Lines)) return for (var/t in Lines) if (!t) diff --git a/code/controllers/subsystem/mob.dm b/code/controllers/subsystem/mob.dm index 60e7476da89b..3596b17e5d16 100644 --- a/code/controllers/subsystem/mob.dm +++ b/code/controllers/subsystem/mob.dm @@ -8,7 +8,7 @@ SUBSYSTEM_DEF(mob) var/list/living_misc_mobs = list() /datum/controller/subsystem/mob/stat_entry(msg) - msg = "P:[living_misc_mobs.len]" + msg = "P:[length(living_misc_mobs)]" return ..() @@ -16,8 +16,8 @@ SUBSYSTEM_DEF(mob) if (!resumed) currentrun = living_misc_mobs.Copy() - while (currentrun.len) - var/mob/living/M = currentrun[currentrun.len] + while (length(currentrun)) + var/mob/living/M = currentrun[length(currentrun)] currentrun.len-- if (!M || QDELETED(M)) diff --git a/code/controllers/subsystem/nanoui.dm b/code/controllers/subsystem/nanoui.dm index 85ad0d32aaf4..b0117016e38b 100644 --- a/code/controllers/subsystem/nanoui.dm +++ b/code/controllers/subsystem/nanoui.dm @@ -13,15 +13,15 @@ SUBSYSTEM_DEF(nano) nanomanager = new() /datum/controller/subsystem/nano/stat_entry(msg) - msg = "P:[nanomanager.processing_uis.len]" + msg = "P:[length(nanomanager.processing_uis)]" return ..() /datum/controller/subsystem/nano/fire(resumed = FALSE) if (!resumed) currentrun = nanomanager.processing_uis.Copy() - while (currentrun.len) - var/datum/nanoui/UI = currentrun[currentrun.len] + while (length(currentrun)) + var/datum/nanoui/UI = currentrun[length(currentrun)] currentrun.len-- if (!UI || QDELETED(UI)) diff --git a/code/controllers/subsystem/perf_logging.dm b/code/controllers/subsystem/perf_logging.dm index 5ca98ad10dd0..4a3066b758ba 100644 --- a/code/controllers/subsystem/perf_logging.dm +++ b/code/controllers/subsystem/perf_logging.dm @@ -26,8 +26,8 @@ SUBSYSTEM_DEF(perf_logging) if(SS?.cost > 0.1) currentrun += SS - while(currentrun.len) - var/datum/controller/subsystem/SS = currentrun[currentrun.len] + while(length(currentrun)) + var/datum/controller/subsystem/SS = currentrun[length(currentrun)] currentrun.len-- var/datum/entity/mc_controller/C = controller_assoc[SS.type] new_record(SS, C) diff --git a/code/controllers/subsystem/ping.dm b/code/controllers/subsystem/ping.dm index c813081ed526..5d413c128684 100644 --- a/code/controllers/subsystem/ping.dm +++ b/code/controllers/subsystem/ping.dm @@ -14,7 +14,7 @@ SUBSYSTEM_DEF(ping) var/list/currentrun = list() /datum/controller/subsystem/ping/stat_entry() - ..("P:[GLOB.clients.len]") + ..("P:[length(GLOB.clients)]") /datum/controller/subsystem/ping/fire(resumed = FALSE) // Prepare the new batch of clients @@ -24,8 +24,8 @@ SUBSYSTEM_DEF(ping) // De-reference the list for sanic speeds var/list/currentrun = src.currentrun - while (currentrun.len) - var/client/client = currentrun[currentrun.len] + while (length(currentrun)) + var/client/client = currentrun[length(currentrun)] currentrun.len-- if (client?.tgui_panel?.is_ready()) diff --git a/code/controllers/subsystem/playtime.dm b/code/controllers/subsystem/playtime.dm index 7a6d3b97a036..6813c4fabd78 100644 --- a/code/controllers/subsystem/playtime.dm +++ b/code/controllers/subsystem/playtime.dm @@ -12,8 +12,8 @@ SUBSYSTEM_DEF(playtime) var/list/currentrun = src.currentrun - while (currentrun.len) - var/client/C = currentrun[currentrun.len] + while (length(currentrun)) + var/client/C = currentrun[length(currentrun)] currentrun.len-- var/mob/M = C.mob diff --git a/code/controllers/subsystem/police_clues.dm b/code/controllers/subsystem/police_clues.dm index 134eae9bca9e..0d39c72c874d 100644 --- a/code/controllers/subsystem/police_clues.dm +++ b/code/controllers/subsystem/police_clues.dm @@ -8,15 +8,15 @@ SUBSYSTEM_DEF(clues) var/list/prints_list = list() /datum/controller/subsystem/clues/stat_entry(msg) - msg = "P:[prints_list.len]" + msg = "P:[length(prints_list)]" return ..() /datum/controller/subsystem/clues/fire(resumed = FALSE) if(!resumed && length(prints_list)) currentrun = prints_list.Copy() - while(currentrun.len) - var/obj/effect/decal/prints/P = currentrun[currentrun.len] + while(length(currentrun)) + var/obj/effect/decal/prints/P = currentrun[length(currentrun)] currentrun.len-- if(!P || QDELETED(P)) diff --git a/code/controllers/subsystem/power.dm b/code/controllers/subsystem/power.dm index 9908a60420b2..08668e5fc564 100644 --- a/code/controllers/subsystem/power.dm +++ b/code/controllers/subsystem/power.dm @@ -12,7 +12,7 @@ SUBSYSTEM_DEF(power) var/list/currentrun_areas = list() /datum/controller/subsystem/power/stat_entry(msg) - msg = "PN:[GLOB.powernets.len]|PM:[GLOB.power_machines.len]|A:[GLOB.active_areas.len]" + msg = "PN:[length(GLOB.powernets)]|PM:[length(GLOB.power_machines)]|A:[length(GLOB.active_areas)]" return ..() @@ -29,8 +29,8 @@ SUBSYSTEM_DEF(power) // First we reset the powernets. // This is done first because we want the power machinery to have acted last on the powernet between intervals. - while(currentrun_powerents.len) - var/datum/powernet/Powernet = currentrun_powerents[currentrun_powerents.len] + while(length(currentrun_powerents)) + var/datum/powernet/Powernet = currentrun_powerents[length(currentrun_powerents)] currentrun_powerents.len-- if(Powernet) Powernet.process() @@ -39,8 +39,8 @@ SUBSYSTEM_DEF(power) // Next we let the power machines operate, this way until the next tick it will be as if they have all done their work. - while (currentrun_power_machines.len) - var/datum/X = currentrun_power_machines[currentrun_power_machines.len] + while (length(currentrun_power_machines)) + var/datum/X = currentrun_power_machines[length(currentrun_power_machines)] currentrun_power_machines.len-- if (!X || QDELETED(X)) continue diff --git a/code/controllers/subsystem/processing/obj_tab_items.dm b/code/controllers/subsystem/processing/obj_tab_items.dm index 53786daf0117..6be6bceab1eb 100644 --- a/code/controllers/subsystem/processing/obj_tab_items.dm +++ b/code/controllers/subsystem/processing/obj_tab_items.dm @@ -12,8 +12,8 @@ PROCESSING_SUBSYSTEM_DEF(obj_tab_items) //cache for sanic speed (lists are references anyways) var/list/current_run = currentrun - while(current_run.len) - var/datum/thing = current_run[current_run.len] + while(length(current_run)) + var/datum/thing = current_run[length(current_run)] if(QDELETED(thing)) processing -= thing else if(thing.process(wait * 0.1) == PROCESS_KILL) diff --git a/code/controllers/subsystem/processing/processing.dm b/code/controllers/subsystem/processing/processing.dm index 73a5db433dc8..c2736528df86 100644 --- a/code/controllers/subsystem/processing/processing.dm +++ b/code/controllers/subsystem/processing/processing.dm @@ -20,8 +20,8 @@ SUBSYSTEM_DEF(processing) //cache for sanic speed (lists are references anyways) var/list/current_run = currentrun - while(current_run.len) - var/datum/thing = current_run[current_run.len] + while(length(current_run)) + var/datum/thing = current_run[length(current_run)] current_run.len-- if(QDELETED(thing)) processing -= thing diff --git a/code/controllers/subsystem/projectiles.dm b/code/controllers/subsystem/projectiles.dm index a23303ea282d..da3b5a7b9c71 100644 --- a/code/controllers/subsystem/projectiles.dm +++ b/code/controllers/subsystem/projectiles.dm @@ -28,7 +28,7 @@ SUBSYSTEM_DEF(projectiles) */ /datum/controller/subsystem/projectiles/stat_entry(msg) - msg = " | #Proj: [projectiles.len]" + msg = " | #Proj: [length(projectiles)]" return ..() /datum/controller/subsystem/projectiles/Initialize(start_timeofday) @@ -41,8 +41,8 @@ SUBSYSTEM_DEF(projectiles) if(!resumed) flying = projectiles.Copy() flying -= sleepers - while(flying.len) - var/obj/projectile/projectile = flying[flying.len] + while(length(flying)) + var/obj/projectile/projectile = flying[length(flying)] flying.len-- var/delta_time = wait * world.tick_lag * (1 SECONDS) handle_projectile_flight(projectile, delta_time) diff --git a/code/controllers/subsystem/quadtrees.dm b/code/controllers/subsystem/quadtrees.dm index da217cb58cee..8c55cb8f1c50 100644 --- a/code/controllers/subsystem/quadtrees.dm +++ b/code/controllers/subsystem/quadtrees.dm @@ -24,17 +24,17 @@ SUBSYSTEM_DEF(quadtree) if(!resumed) player_feed = GLOB.clients.Copy() cur_quadtrees = new_quadtrees.Copy() - if(new_quadtrees.len < world.maxz) + if(length(new_quadtrees) < world.maxz) new_quadtrees.len = world.maxz for(var/i in 1 to world.maxz) new_quadtrees[i] = QTREE(RECT(world.maxx/2,world.maxy/2, world.maxx, world.maxy), i) while(length(player_feed)) - var/client/C = player_feed[player_feed.len] + var/client/C = player_feed[length(player_feed)] player_feed.len-- if(!C) continue var/turf/T = get_turf(C.mob) - if(!T?.z || new_quadtrees.len < T.z) + if(!T?.z || length(new_quadtrees) < T.z) continue var/datum/coords/qtplayer/p_coords = new p_coords.player = C @@ -52,7 +52,7 @@ SUBSYSTEM_DEF(quadtree) var/list/players = list() if(!cur_quadtrees) return players - if(z_level && cur_quadtrees.len >= z_level) + if(z_level && length(cur_quadtrees) >= z_level) var/datum/quadtree/Q = cur_quadtrees[z_level] if(!Q) return players diff --git a/code/controllers/subsystem/round_recording.dm b/code/controllers/subsystem/round_recording.dm index f1244d386d10..e45854ac5730 100644 --- a/code/controllers/subsystem/round_recording.dm +++ b/code/controllers/subsystem/round_recording.dm @@ -35,8 +35,8 @@ SUBSYSTEM_DEF(round_recording) return currentrun = recorder.tracked_players.Copy() - while(currentrun.len) - var/mob/M = currentrun[currentrun.len] + while(length(currentrun)) + var/mob/M = currentrun[length(currentrun)] currentrun.len-- // Try to stop the tracking diff --git a/code/controllers/subsystem/shuttles.dm b/code/controllers/subsystem/shuttles.dm index 0348eddd9900..d400e02f3bae 100644 --- a/code/controllers/subsystem/shuttles.dm +++ b/code/controllers/subsystem/shuttles.dm @@ -94,7 +94,7 @@ SUBSYSTEM_DEF(shuttle) qdel(T, force=TRUE) if(!SSmapping.clearing_reserved_turfs) - while(transit_requesters.len) + while(length(transit_requesters)) var/requester = popleft(transit_requesters) var/success = null // Do not try and generate any transit if we're using more then our max already @@ -311,7 +311,7 @@ SUBSYSTEM_DEF(shuttle) /datum/controller/subsystem/shuttle/proc/get_containing_shuttle(atom/A) var/list/mobile_cache = mobile - for(var/i in 1 to mobile_cache.len) + for(var/i in 1 to length(mobile_cache)) var/obj/docking_port/port = mobile_cache[i] if(port.is_in_shuttle_bounds(A)) return port @@ -319,7 +319,7 @@ SUBSYSTEM_DEF(shuttle) /datum/controller/subsystem/shuttle/proc/get_containing_dock(atom/A) . = list() var/list/stationary_cache = stationary - for(var/i in 1 to stationary_cache.len) + for(var/i in 1 to length(stationary_cache)) var/obj/docking_port/port = stationary_cache[i] if(port.is_in_shuttle_bounds(A)) . += port @@ -327,7 +327,7 @@ SUBSYSTEM_DEF(shuttle) /datum/controller/subsystem/shuttle/proc/get_dock_overlap(x0, y0, x1, y1, z) . = list() var/list/stationary_cache = stationary - for(var/i in 1 to stationary_cache.len) + for(var/i in 1 to length(stationary_cache)) var/obj/docking_port/port = stationary_cache[i] if(!port || port.z != z) continue @@ -335,7 +335,7 @@ SUBSYSTEM_DEF(shuttle) var/list/overlap = get_overlap(x0, y0, x1, y1, bounds[1], bounds[2], bounds[3], bounds[4]) var/list/xs = overlap[1] var/list/ys = overlap[2] - if(xs.len && ys.len) + if(length(xs) && length(ys)) .[port] = overlap /datum/controller/subsystem/shuttle/proc/update_hidden_docking_ports(list/remove_turfs, list/add_turfs) @@ -353,7 +353,7 @@ SUBSYSTEM_DEF(shuttle) for(var/V in add_turfs) var/turf/T = V var/image/I - if(remove_images.len) + if(length(remove_images)) //we can just reuse any images we are about to delete instead of making new ones I = remove_images[1] remove_images.Cut(1, 2) diff --git a/code/controllers/subsystem/sound.dm b/code/controllers/subsystem/sound.dm index 4fdfd7935349..024df7cc45ad 100644 --- a/code/controllers/subsystem/sound.dm +++ b/code/controllers/subsystem/sound.dm @@ -24,7 +24,7 @@ SUBSYSTEM_DEF(sound) if(MC_TICK_CHECK) return while(length(run_hearers)) // Output sound to hearers - var/client/C = run_hearers[run_hearers.len] + var/client/C = run_hearers[length(run_hearers)] run_hearers.len-- if(C && C.soundOutput) C.soundOutput.process_sound(run_template) @@ -40,6 +40,6 @@ SUBSYSTEM_DEF(sound) for(var/datum/interior/VI in extra_interiors) if(VI?.ready) var/list/bounds = VI.get_middle_coords() - if(bounds.len >= 2) + if(length(bounds) >= 2) hearers |= SSquadtree.players_in_range(RECT(bounds[1], bounds[2], VI.map_template.width, VI.map_template.height), bounds[3]) template_queue[template] = hearers diff --git a/code/controllers/subsystem/soundscape.dm b/code/controllers/subsystem/soundscape.dm index 2219a0b35c86..432166e06be9 100644 --- a/code/controllers/subsystem/soundscape.dm +++ b/code/controllers/subsystem/soundscape.dm @@ -15,8 +15,8 @@ SUBSYSTEM_DEF(soundscape) if(!resumed) currentrun = GLOB.clients.Copy() - while(currentrun.len) - var/client/C = currentrun[currentrun.len] + while(length(currentrun)) + var/client/C = currentrun[length(currentrun)] currentrun.len-- if(!C || !C.soundOutput) diff --git a/code/controllers/subsystem/statpanel.dm b/code/controllers/subsystem/statpanel.dm index 030043d12d3a..613c8df5850f 100644 --- a/code/controllers/subsystem/statpanel.dm +++ b/code/controllers/subsystem/statpanel.dm @@ -197,7 +197,7 @@ SUBSYSTEM_DEF(statpanels) /datum/controller/subsystem/statpanels/proc/generate_mc_data() mc_data = list( list("CPU:", world.cpu), - list("Instances:", "[num2text(world.contents.len, 10)]"), + list("Instances:", "[num2text(length(world.contents), 10)]"), list("World Time:", "[world.time]"), list("Globals:", GLOB.stat_entry(), "\ref[GLOB]"), list("[config]:", config.stat_entry(), "\ref[config]"), diff --git a/code/controllers/subsystem/tgui.dm b/code/controllers/subsystem/tgui.dm index 0bd0c29e450a..a3ef03f3e397 100644 --- a/code/controllers/subsystem/tgui.dm +++ b/code/controllers/subsystem/tgui.dm @@ -45,8 +45,8 @@ SUBSYSTEM_DEF(tgui) src.current_run = open_uis.Copy() // Cache for sanic speed (lists are references anyways) var/list/current_run = src.current_run - while(current_run.len) - var/datum/tgui/ui = current_run[current_run.len] + while(length(current_run)) + var/datum/tgui/ui = current_run[length(current_run)] current_run.len-- // TODO: Move user/src_object check to process() if(ui?.user && ui.src_object) diff --git a/code/controllers/subsystem/tracking.dm b/code/controllers/subsystem/tracking.dm index 3955ace8da09..4dcc5d5c4e29 100644 --- a/code/controllers/subsystem/tracking.dm +++ b/code/controllers/subsystem/tracking.dm @@ -98,7 +98,7 @@ SUBSYSTEM_DEF(tracking) /datum/controller/subsystem/tracking/proc/setup_trackers(mob/mob, tracked_group) if(!tracked_group) - tracked_group = "tracked_[tracked_mobs.len]" + tracked_group = "tracked_[length(tracked_mobs)]" tracked_mobs[tracked_group] = list() leaders[tracked_group] = mob diff --git a/code/controllers/subsystem/xeno.dm b/code/controllers/subsystem/xeno.dm index 0623da804254..df711fd90366 100644 --- a/code/controllers/subsystem/xeno.dm +++ b/code/controllers/subsystem/xeno.dm @@ -7,7 +7,7 @@ SUBSYSTEM_DEF(xeno) var/list/currentrun = list() /datum/controller/subsystem/xeno/stat_entry(msg) - msg = "P:[GLOB.xeno_mob_list.len]" + msg = "P:[length(GLOB.xeno_mob_list)]" return ..() @@ -15,8 +15,8 @@ SUBSYSTEM_DEF(xeno) if (!resumed) currentrun = GLOB.xeno_mob_list.Copy() - while (currentrun.len) - var/mob/living/carbon/xenomorph/M = currentrun[currentrun.len] + while (length(currentrun)) + var/mob/living/carbon/xenomorph/M = currentrun[length(currentrun)] currentrun.len-- if (!M || QDELETED(M)) diff --git a/code/datums/_ndatabase/code/brsql_adapter.dm b/code/datums/_ndatabase/code/brsql_adapter.dm index 251267a04fdb..2362572f588a 100644 --- a/code/datums/_ndatabase/code/brsql_adapter.dm +++ b/code/datums/_ndatabase/code/brsql_adapter.dm @@ -103,7 +103,7 @@ /datum/db/adapter/brsql_adapter/insert_table(table_name, list/values, datum/callback/CB, sync = FALSE) set waitfor = FALSE - var/length = values.len + var/length = length(values) var/list/qpars = list() var/query_inserttable = getquery_insert_table(table_name, values, qpars) var/datum/callback/callback = CALLBACK(src, TYPE_PROC_REF(/datum/db/adapter/brsql_adapter, after_insert_table), CB, length, table_name) @@ -150,7 +150,7 @@ if(table_meta.status != DB_QUERY_FINISHED) issue_log += "Unable to access system table, error: '[table_meta.error]'" return FALSE // OH SHIT OH FUCK - if(!table_meta.results.len) // Table doesn't exist + if(!length(table_meta.results)) // Table doesn't exist return internal_create_table(table_name, field_types) && internal_record_table_in_sys(type_name, table_name, field_types) var/id = table_meta.results[1][DB_DEFAULT_ID_FIELD] @@ -178,7 +178,7 @@ if(index_meta.status != DB_QUERY_FINISHED) issue_log += "Unable to access system index table, error: '[index_meta.error]'" return FALSE // OH SHIT OH FUCK - if(!index_meta.results.len) // Index doesn't exist + if(!length(index_meta.results)) // Index doesn't exist return internal_create_index(index_name, table_name, fields, unique, cluster) && internal_record_index_in_sys(index_name, table_name, fields) var/id = index_meta.results[1][DB_DEFAULT_ID_FIELD] diff --git a/code/datums/_ndatabase/code/native_adapter.dm b/code/datums/_ndatabase/code/native_adapter.dm index 1c23a6ceab8f..d5956ca8d85f 100644 --- a/code/datums/_ndatabase/code/native_adapter.dm +++ b/code/datums/_ndatabase/code/native_adapter.dm @@ -92,7 +92,7 @@ /datum/db/adapter/native_adapter/insert_table(table_name, list/values, datum/callback/CB, sync = FALSE) set waitfor = 0 - var/length = values.len + var/length = length(values) var/startid = internal_request_insert_allocation(table_name, length) var/list/qpars = list() var/query_inserttable = getquery_insert_table(table_name, values, startid, qpars) @@ -138,7 +138,7 @@ if(table_meta.status != DB_QUERY_FINISHED) issue_log += "Unable to access system table, error: '[table_meta.error]'" return FALSE // OH SHIT OH FUCK - if(!table_meta.results.len) // Table doesn't exist + if(!length(table_meta.results)) // Table doesn't exist return internal_create_table(table_name, field_types) && internal_record_table_in_sys(type_name, table_name, field_types) var/id = table_meta.results[1][DB_DEFAULT_ID_FIELD] diff --git a/code/datums/_ndatabase/code/native_persistent_query.dm b/code/datums/_ndatabase/code/native_persistent_query.dm index 15e505d578d7..39025aa1fd93 100644 --- a/code/datums/_ndatabase/code/native_persistent_query.dm +++ b/code/datums/_ndatabase/code/native_persistent_query.dm @@ -29,7 +29,7 @@ /datum/db/query/native/read_single() if(status >= DB_QUERY_FINISHED || completed) //broken or finished return - + if(!completed) completed = TRUE var/status = query.Execute(db) @@ -41,9 +41,9 @@ if(!results) results = list() var/list/cols = query.Columns() - if(cols && cols.len>0) + if(LAZYLEN(cols)>0) while(query.NextRow()) var/list/current_row = query.GetRowData() results += list(current_row) - affected_rows = query.RowsAffected() + affected_rows = query.RowsAffected() status = DB_QUERY_FINISHED diff --git a/code/datums/_ndatabase/subsystems/database_query_manager.dm b/code/datums/_ndatabase/subsystems/database_query_manager.dm index 596d55121920..5a68c4e349c1 100644 --- a/code/datums/_ndatabase/subsystems/database_query_manager.dm +++ b/code/datums/_ndatabase/subsystems/database_query_manager.dm @@ -62,7 +62,7 @@ GLOBAL_REAL(SSdatabase, /datum/controller/subsystem/database_query_manager) /datum/controller/subsystem/database_query_manager/stat_entry(msg) var/text = (connection && connection.status == DB_CONNECTION_READY) ? ("READY") : ("PREPPING") - msg = "[text], AQ:[queries_active.len]; SQ:[queries_standby.len]; P:[queries_current.len]; C:[in_callback]" + msg = "[text], AQ:[length(queries_active)]; SQ:[length(queries_standby)]; P:[length(queries_current)]; C:[in_callback]" return ..() /datum/controller/subsystem/database_query_manager/fire(resumed = FALSE) diff --git a/code/datums/_ndatabase/subsystems/entity_manager.dm b/code/datums/_ndatabase/subsystems/entity_manager.dm index 833bc6926e09..2ef5da2b22dd 100644 --- a/code/datums/_ndatabase/subsystems/entity_manager.dm +++ b/code/datums/_ndatabase/subsystems/entity_manager.dm @@ -102,8 +102,8 @@ GLOBAL_REAL(SSentity_manager, /datum/controller/subsystem/entity_manager) currentrun = tables_unsorted.Copy() if(!SSdatabase.connection.connection_ready()) return - while (currentrun.len) - var/datum/entity_meta/Q = currentrun[currentrun.len] + while (length(currentrun)) + var/datum/entity_meta/Q = currentrun[length(currentrun)] do_select(Q) do_insert(Q) do_update(Q) diff --git a/code/datums/_ndatabase/tests/test_entity.dm b/code/datums/_ndatabase/tests/test_entity.dm index de1942eec7d3..3bc9cc829bf4 100644 --- a/code/datums/_ndatabase/tests/test_entity.dm +++ b/code/datums/_ndatabase/tests/test_entity.dm @@ -50,7 +50,7 @@ SSentity_manager.filter_then(/datum/entity/test_entity, DB_COMP("value", DB_EQUALS, value), CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(log_filter))) /proc/log_filter(list/datum/entity/elist) - to_world("got [elist.len] items") + to_world("got [length(elist)] items") /proc/log_sync(datum/entity/test_entity/ET) to_world("id:[ET.id] = name: [ET.name], description: [ET.description], value: [ET.value]") diff --git a/code/datums/ammo/ammo.dm b/code/datums/ammo/ammo.dm index a59290ab5f51..022909691cfc 100644 --- a/code/datums/ammo/ammo.dm +++ b/code/datums/ammo/ammo.dm @@ -212,7 +212,7 @@ M.apply_damage(damage,damage_type) - if(XNO && XNO.xeno_shields.len) + if(XNO && length(XNO.xeno_shields)) P.play_shielded_hit_effect(M) else P.play_hit_effect(M) diff --git a/code/datums/ammo/misc.dm b/code/datums/ammo/misc.dm index d3ce356372be..9a9ed2fb505b 100644 --- a/code/datums/ammo/misc.dm +++ b/code/datums/ammo/misc.dm @@ -200,7 +200,7 @@ if(!M || M == P.firer) return if(M.throw_mode && !M.get_active_hand()) //empty active hand and we're in throw mode. If so we catch the can. if(!M.is_mob_incapacitated()) // People who are not able to catch cannot catch. - if(P.contents.len == 1) + if(length(P.contents) == 1) for(var/obj/item/reagent_container/food/drinks/cans/souto/S in P.contents) M.put_in_active_hand(S) for(var/mob/O in viewers(GLOB.world_view_size, P)) //find all people in view. @@ -214,7 +214,7 @@ H.apply_effect(15, DAZE) H.apply_effect(15, SLOW) shake_camera(H, 2, 1) - if(P.contents.len) + if(length(P.contents)) drop_can(P.loc, P) //We make a can at the location. /datum/ammo/souto/on_hit_obj(obj/O,obj/projectile/P) @@ -230,7 +230,7 @@ drop_can(P.loc, P) //We make a can at the location. /datum/ammo/souto/proc/drop_can(loc, obj/projectile/P) - if(P.contents.len) + if(length(P.contents)) for(var/obj/item/I in P.contents) I.forceMove(loc) randomize_projectile(P) diff --git a/code/datums/browser.dm b/code/datums/browser.dm index 3b694e8f44bb..f7626214a73e 100644 --- a/code/datums/browser.dm +++ b/code/datums/browser.dm @@ -117,9 +117,9 @@ window_size = "size=[width]x[height];" common_asset.send(user) other_asset.send(user) - if (stylesheets.len) + if (length(stylesheets)) SSassets.transport.send_assets(user, stylesheets) - if (scripts.len) + if (length(scripts)) SSassets.transport.send_assets(user, scripts) user << browse(get_content(), "window=[window_id];[window_size][window_options]") diff --git a/code/datums/components/_component.dm b/code/datums/components/_component.dm index c998bd55257c..f356fc5c1077 100644 --- a/code/datums/components/_component.dm +++ b/code/datums/components/_component.dm @@ -102,7 +102,7 @@ components_of_type = test if(I == our_type) //exact match, take priority var/inserted = FALSE - for(var/J in 1 to components_of_type.len) + for(var/J in 1 to length(components_of_type)) var/datum/component/C = components_of_type[J] if(C.type != our_type) //but not over other exact matches components_of_type.Insert(J, I) @@ -127,13 +127,13 @@ var/list/components_of_type = dc[I] if(length(components_of_type)) // var/list/subtracted = components_of_type - src - if(subtracted.len == 1) //only 1 guy left + if(length(subtracted) == 1) //only 1 guy left dc[I] = subtracted[1] //make him special else dc[I] = subtracted else //just us dc -= I - if(!dc.len) + if(!length(dc)) P.datum_components = null UnregisterFromParent() @@ -243,7 +243,7 @@ lookup[sig] -= src signal_procs[target] -= sig_type_or_types - if(!signal_procs[target].len) + if(!length(signal_procs[target])) signal_procs -= target /** diff --git a/code/datums/datum.dm b/code/datums/datum.dm index 3e317ffd601e..e926dfd022ca 100644 --- a/code/datums/datum.dm +++ b/code/datums/datum.dm @@ -119,7 +119,7 @@ var/datum/component/C = all_components qdel(C, FALSE, TRUE) if(datum_components) - debug_log("'[src]' datum_components was not null after removing all components! [datum_components.len] entries remained...") + debug_log("'[src]' datum_components was not null after removing all components! [length(datum_components)] entries remained...") datum_components.Cut() var/list/lookup = comp_lookup diff --git a/code/datums/diseases/advance/advance.dm b/code/datums/diseases/advance/advance.dm index 6ccbaa66e7de..41f1fe30e921 100644 --- a/code/datums/diseases/advance/advance.dm +++ b/code/datums/diseases/advance/advance.dm @@ -50,7 +50,7 @@ GLOBAL_LIST_INIT(advance_cures, list( /datum/disease/advance/New(process = 1, datum/disease/advance/D) // Setup our dictionary if it hasn't already. - if(!GLOB.dictionary_symptoms.len) + if(!length(GLOB.dictionary_symptoms)) for(var/symp in GLOB.list_symptoms) var/datum/symptom/S = new symp GLOB.dictionary_symptoms[S.id] = symp @@ -59,9 +59,9 @@ GLOBAL_LIST_INIT(advance_cures, list( D = null // Generate symptoms if we weren't given any. - if(!symptoms || !symptoms.len) + if(!LAZYLEN(symptoms)) - if(!D || !D.symptoms || !D.symptoms.len) + if(!D || !LAZYLEN(D.symptoms)) symptoms = GenerateSymptoms() else for(var/datum/symptom/S in D.symptoms) @@ -80,7 +80,7 @@ GLOBAL_LIST_INIT(advance_cures, list( // Randomly pick a symptom to activate. /datum/disease/advance/stage_act() ..() - if(symptoms && symptoms.len) + if(LAZYLEN(symptoms)) if(!processing) processing = 1 @@ -148,7 +148,7 @@ GLOBAL_LIST_INIT(advance_cures, list( if(!HasSymptom(S)) possible_symptoms += S - if(!possible_symptoms.len) + if(!length(possible_symptoms)) return //error("Advance Disease - We weren't able to get any possible symptoms in GenerateSymptoms([type_level_limit], [amount_get])") @@ -182,7 +182,7 @@ GLOBAL_LIST_INIT(advance_cures, list( //Generate disease properties based on the effects. Returns an associated list. /datum/disease/advance/proc/GenerateProperties() - if(!symptoms || !symptoms.len) + if(!LAZYLEN(symptoms)) CRASH("We did not have any symptoms before generating properties.") var/list/properties = list("resistance" = 1, "stealth" = 1, "stage_rate" = 1, "transmittable" = 1, "severity" = 1) @@ -200,11 +200,11 @@ GLOBAL_LIST_INIT(advance_cures, list( // Assign the properties that are in the list. /datum/disease/advance/proc/AssignProperties(list/properties = list()) - if(properties && properties.len) + if(LAZYLEN(properties)) hidden = list( (properties["stealth"] > 2), (properties["stealth"] > 3) ) // The more symptoms we have, the less transmittable it is but some symptoms can make up for it. - SetSpread(clamp(properties["transmittable"] - symptoms.len, BLOOD, AIRBORNE)) + SetSpread(clamp(properties["transmittable"] - length(symptoms), BLOOD, AIRBORNE)) permeability_mod = max(ceil(0.4 * properties["transmittable"]), 1) cure_chance = 15 - clamp(properties["resistance"], -5, 5) // can be between 10 and 20 stage_prob = max(properties["stage_rate"], 2) @@ -253,8 +253,8 @@ GLOBAL_LIST_INIT(advance_cures, list( // Will generate a random cure, the less resistance the symptoms have, the harder the cure. /datum/disease/advance/proc/GenerateCure(list/properties = list()) - if(properties && properties.len) - var/res = clamp(properties["resistance"] - (symptoms.len / 2), 1, GLOB.advance_cures.len) + if(LAZYLEN(properties)) + var/res = clamp(properties["resistance"] - (length(symptoms) / 2), 1, length(GLOB.advance_cures)) cure_id = GLOB.advance_cures[res] // Get the cure name from the cure_id @@ -274,7 +274,7 @@ GLOBAL_LIST_INIT(advance_cures, list( // Randomly remove a symptom. /datum/disease/advance/proc/Devolve() - if(symptoms.len > 1) + if(length(symptoms) > 1) var/s = SAFEPICK(symptoms) if(s) RemoveSymptom(s) @@ -305,7 +305,7 @@ GLOBAL_LIST_INIT(advance_cures, list( if(HasSymptom(S)) return - if(symptoms.len < 5 + rand(-1, 1)) + if(length(symptoms) < 5 + rand(-1, 1)) symptoms += S else RemoveSymptom(pick(symptoms)) @@ -331,14 +331,14 @@ GLOBAL_LIST_INIT(advance_cures, list( for(var/datum/disease/advance/A in D_list) diseases += A.Copy() - if(!diseases.len) + if(!length(diseases)) return null - if(diseases.len <= 1) + if(length(diseases) <= 1) return pick(diseases) // Just return the only entry. var/i = 0 // Mix our diseases until we are left with only one result. - while(i < 20 && diseases.len > 1) + while(i < 20 && length(diseases) > 1) i++ @@ -362,7 +362,7 @@ GLOBAL_LIST_INIT(advance_cures, list( R.data_properties = data.Copy() else R.data_properties = data - if(preserve.len) + if(length(preserve)) R.data_properties["viruses"] = preserve /proc/AdminCreateVirus(mob/user) @@ -385,7 +385,7 @@ GLOBAL_LIST_INIT(advance_cures, list( i-- while(i > 0) - if(D.symptoms.len > 0) + if(length(D.symptoms) > 0) var/new_name = input(user, "Name your new disease.", "New Name") D.AssignName(new_name) diff --git a/code/datums/diseases/advance/symptoms/symptoms.dm b/code/datums/diseases/advance/symptoms/symptoms.dm index 7746a03b4f89..8ddd5897f92a 100644 --- a/code/datums/diseases/advance/symptoms/symptoms.dm +++ b/code/datums/diseases/advance/symptoms/symptoms.dm @@ -17,7 +17,7 @@ GLOBAL_LIST_EMPTY(dictionary_symptoms) /datum/symptom/New() var/list/S = GLOB.list_symptoms - for(var/i = 1; i <= S.len; i++) + for(var/i = 1; i <= length(S); i++) if(src.type == S[i]) id = "[i]" return diff --git a/code/datums/diseases/black_goo.dm b/code/datums/diseases/black_goo.dm index 99e5f6084de2..056034d32fb2 100644 --- a/code/datums/diseases/black_goo.dm +++ b/code/datums/diseases/black_goo.dm @@ -301,12 +301,12 @@ /obj/item/storage/fancy/blackgoo/get_examine_text(mob/user) . = ..() . += "A strange looking metal container..." - if(contents.len <= 0) + if(length(contents) <= 0) . += "There are no bottles left inside it." - else if(contents.len == 1) + else if(length(contents) == 1) . += "There is one bottle left inside it." else - . += "There are [src.contents.len] bottles inside the container." + . += "There are [length(src.contents)] bottles inside the container." /obj/item/storage/fancy/blackgoo/Initialize() diff --git a/code/datums/elements/mouth_drop_item.dm b/code/datums/elements/mouth_drop_item.dm index 7a546c6b3933..f27e1b928b7d 100644 --- a/code/datums/elements/mouth_drop_item.dm +++ b/code/datums/elements/mouth_drop_item.dm @@ -18,7 +18,7 @@ /datum/element/mouth_drop_item/proc/item_equipped(obj/item/I, mob/living/carbon/human/user, slot) SIGNAL_HANDLER - if(slot == WEAR_FACE) + if(slot == WEAR_FACE && !HAS_TRAIT(user, TRAIT_IRON_TEETH)) I.RegisterSignal(user, COMSIG_LIVING_SET_BODY_POSITION, TYPE_PROC_REF(/obj/item, drop_to_floor)) /datum/element/mouth_drop_item/proc/item_dropped(obj/item/I, mob/living/carbon/human/user) diff --git a/code/datums/emergency_calls/custom.dm b/code/datums/emergency_calls/custom.dm index 0117c83fc19c..b62d984f6fe3 100644 --- a/code/datums/emergency_calls/custom.dm +++ b/code/datums/emergency_calls/custom.dm @@ -19,7 +19,7 @@ if(!istype(spawn_loc)) return //Didn't find a useable spawn point. - if(!players_to_offer.len) + if(!length(players_to_offer)) return // No more players var/mob/living/carbon/human/H = pick(players_to_offer) diff --git a/code/datums/emergency_calls/emergency_call.dm b/code/datums/emergency_calls/emergency_call.dm index a803a7f06c78..99b31ab41f19 100644 --- a/code/datums/emergency_calls/emergency_call.dm +++ b/code/datums/emergency_calls/emergency_call.dm @@ -64,11 +64,11 @@ var/home_base = /datum/lazy_template/ert/freelancer_station /datum/game_mode/proc/initialize_emergency_calls() - if(all_calls.len) //It's already been set up. + if(length(all_calls)) //It's already been set up. return var/list/total_calls = typesof(/datum/emergency_call) - if(!total_calls.len) + if(!length(total_calls)) to_world(SPAN_DANGER("\b Error setting up emergency calls, no datums found.")) return FALSE for(var/S in total_calls) @@ -154,7 +154,7 @@ if(jobban_isbanned(src, "Syndicate") || jobban_isbanned(src, "Emergency Response Team")) to_chat(src, SPAN_DANGER("You are jobbanned from the emergency response team!")) return - if(!SSticker.mode || !SSticker.mode.picked_calls.len) + if(!SSticker.mode || !length(SSticker.mode.picked_calls)) to_chat(src, SPAN_WARNING("No distress beacons are active. You will be notified if this changes.")) return @@ -230,8 +230,8 @@ SEND_SIGNAL(src, COMSIG_ERT_SETUP) - if(candidates.len < mob_min && !spawn_max_amount) - message_admins("Aborting distress beacon, not enough candidates: found [candidates.len].") + if(length(candidates) < mob_min && !spawn_max_amount) + message_admins("Aborting distress beacon, not enough candidates: found [length(candidates)].") members = list() //Empty the members list. candidates = list() @@ -244,7 +244,7 @@ var/list/datum/mind/picked_candidates = list() if(mob_max > 0) var/mob_count = 0 - while (mob_count < mob_max && candidates.len) + while (mob_count < mob_max && length(candidates)) var/datum/mind/M = pick(candidates) //Get a random candidate, then remove it from the candidates list. if(!istype(M))//Something went horrifically wrong candidates.Remove(M) @@ -254,13 +254,13 @@ continue if(M.current && M.current.stat != DEAD) candidates.Remove(M) //Strip them from the list, they aren't dead anymore. - if(!candidates.len) + if(!length(candidates)) break //NO picking from empty lists continue picked_candidates.Add(M) candidates.Remove(M) mob_count++ - if(candidates.len) + if(length(candidates)) for(var/datum/mind/I in candidates) if(I.current) to_chat(I.current, SPAN_WARNING("You didn't get selected to join the distress team. Better luck next time!")) @@ -310,7 +310,7 @@ SSshuttle.moveShuttleToDock(shuttle, pick(active_lzs), TRUE) var/i = 0 - if(picked_candidates.len) + if(length(picked_candidates)) for(var/datum/mind/M in picked_candidates) members += M i++ diff --git a/code/datums/entities/player.dm b/code/datums/entities/player.dm index a62e663ba21c..fbdcc11e1037 100644 --- a/code/datums/entities/player.dm +++ b/code/datums/entities/player.dm @@ -606,14 +606,14 @@ BSQL_PROTECT_DATUM(/datum/entity/player) note.admin_rank = "N/A" note.date = I.timestamp var/list/splitting = splittext(I.content, "|") - if(splitting.len == 1) + if(length(splitting) == 1) note.text = I.content note.is_ban = FALSE - if(splitting.len == 3) + if(length(splitting) == 3) note.text = splitting[3] note.ban_time = text2num(replacetext(replacetext(splitting[2],"Duration: ","")," minutes","")) note.is_ban = TRUE - if(splitting.len == 2) + if(length(splitting) == 2) note.text = I.content note.is_ban = TRUE diff --git a/code/datums/global_variables.dm b/code/datums/global_variables.dm index 53e9c0391e17..24d32bbf3552 100644 --- a/code/datums/global_variables.dm +++ b/code/datums/global_variables.dm @@ -154,9 +154,9 @@ else if (istype(value, /list)) var/list/L = value - html += "[name] = /list ([L.len])" + html += "[name] = /list ([length(L)])" - if (L.len > 0 && !(name == "underlays" || name == "overlays" || name == "vars" || L.len > 500)) + if (length(L) > 0 && !(name == "underlays" || name == "overlays" || name == "vars" || length(L) > 500)) // not sure if this is completely right... html += "