mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-14 00:23:29 +01:00
Changes all .len to length() where applicable (#25174)
* Globals work
* Double access works
* All other things
* Revert "All other things"
This reverts commit 6574442eb6.
* More changes that compile and work
* IT WORKS AAAAAA
* Changes even more .len to length()
* Apply suggestions from code review
* Update code/datums/mind.dm
* Update code/__HELPERS/sorts/InsertSort.dm
Co-authored-by: Deniz <66401072+Oyu07@users.noreply.github.com>
* Update code/__HELPERS/sanitize_values.dm
Co-authored-by: Deniz <66401072+Oyu07@users.noreply.github.com>
---------
Co-authored-by: FunnyMan3595 (Charlie Nolan) <funnyman@google.com>
Co-authored-by: Deniz <66401072+Oyu07@users.noreply.github.com>
This commit is contained in:
@@ -152,7 +152,7 @@
|
||||
memolist += "[ckey]"
|
||||
|
||||
qdel(query_memodellist)
|
||||
if(!memolist.len)
|
||||
if(!length(memolist))
|
||||
to_chat(src, "No memos found in database.")
|
||||
return
|
||||
|
||||
|
||||
@@ -871,7 +871,7 @@ GLOBAL_LIST_INIT(view_runtimes_verbs, list(
|
||||
for(var/datum/job/J in SSjobs.occupations)
|
||||
if(J.current_positions >= J.total_positions && J.total_positions != -1)
|
||||
jobs += J.title
|
||||
if(!jobs.len)
|
||||
if(!length(jobs))
|
||||
to_chat(usr, "There are no fully staffed jobs.")
|
||||
return
|
||||
var/job = input("Please select job slot to free", "Free Job Slot") as null|anything in jobs
|
||||
|
||||
@@ -111,9 +111,9 @@ GLOBAL_VAR_INIT(nologevent, 0)
|
||||
body += "<a href='byond://?_src_=holder;adminalert=[M.UID()]'>SEND ALERT</a>\]</b><br>"
|
||||
body += "<b>Mob type:</b> [M.type]<br>"
|
||||
if(M.client)
|
||||
if(M.client.related_accounts_cid.len)
|
||||
if(length(M.client.related_accounts_cid))
|
||||
body += "<b>Related accounts by CID:</b> [jointext(M.client.related_accounts_cid, " - ")]<br>"
|
||||
if(M.client.related_accounts_ip.len)
|
||||
if(length(M.client.related_accounts_ip))
|
||||
body += "<b>Related accounts by IP:</b> [jointext(M.client.related_accounts_ip, " - ")]<br><br>"
|
||||
|
||||
if(M.ckey)
|
||||
@@ -726,11 +726,11 @@ GLOBAL_VAR_INIT(nologevent, 0)
|
||||
if(copytext("[path]", -needle_length) == object)
|
||||
matches += path
|
||||
|
||||
if(matches.len==0)
|
||||
if(length(matches)==0)
|
||||
return
|
||||
|
||||
var/chosen
|
||||
if(matches.len==1)
|
||||
if(length(matches)==1)
|
||||
chosen = matches[1]
|
||||
else
|
||||
chosen = input("Select an atom type", "Spawn Atom", matches[1]) as null|anything in matches
|
||||
|
||||
@@ -366,7 +366,7 @@
|
||||
dat += "<a href='byond://?src=[UID()];delay_round_end=1'>[SSticker.delay_end ? "End Round Normally" : "Delay Round End"]</a><br>"
|
||||
dat += "<br><b>Antagonist Teams</b><br>"
|
||||
dat += "<a href='byond://?src=[UID()];check_teams=1'>View Teams</a><br>"
|
||||
if(SSticker.mode.syndicates.len)
|
||||
if(length(SSticker.mode.syndicates))
|
||||
dat += "<br><table cellspacing=5><tr><td><B>Syndicates</B></td><td></td></tr>"
|
||||
for(var/datum/mind/N in SSticker.mode.syndicates)
|
||||
var/mob/M = N.current
|
||||
@@ -413,65 +413,65 @@
|
||||
dat += "</table>"
|
||||
|
||||
|
||||
if(SSticker.mode.blob_overminds.len)
|
||||
if(length(SSticker.mode.blob_overminds))
|
||||
dat += check_role_table("Blob Overminds", SSticker.mode.blob_overminds)
|
||||
dat += "<i>Blob Tiles: [length(GLOB.blobs)]</i>"
|
||||
|
||||
if(SSticker.mode.changelings.len)
|
||||
if(length(SSticker.mode.changelings))
|
||||
dat += check_role_table("Changelings", SSticker.mode.changelings)
|
||||
|
||||
if(SSticker.mode.wizards.len)
|
||||
if(length(SSticker.mode.wizards))
|
||||
dat += check_role_table("Wizards", SSticker.mode.wizards)
|
||||
|
||||
if(SSticker.mode.apprentices.len)
|
||||
if(length(SSticker.mode.apprentices))
|
||||
dat += check_role_table("Apprentices", SSticker.mode.apprentices)
|
||||
|
||||
/*if(ticker.mode.ninjas.len)
|
||||
/*if(length(ticker.mode.ninjas))
|
||||
dat += check_role_table("Ninjas", ticker.mode.ninjas)*/
|
||||
|
||||
if(SSticker.mode.cult_team)
|
||||
dat += check_role_table("Cultists", SSticker.mode.cult_team.members)
|
||||
dat += "<a href='byond://?src=[UID()];check_teams=1'>View Cult Team & Controls</a><br>"
|
||||
|
||||
if(SSticker.mode.traitors.len)
|
||||
if(length(SSticker.mode.traitors))
|
||||
dat += check_role_table("Traitors", SSticker.mode.traitors)
|
||||
|
||||
if(SSticker.mode.implanted.len)
|
||||
if(length(SSticker.mode.implanted))
|
||||
dat += check_role_table("Mindslaves", SSticker.mode.implanted)
|
||||
|
||||
if(SSticker.mode.abductors.len)
|
||||
if(length(SSticker.mode.abductors))
|
||||
dat += check_role_table("Abductors", SSticker.mode.abductors)
|
||||
|
||||
if(SSticker.mode.abductees.len)
|
||||
if(length(SSticker.mode.abductees))
|
||||
dat += check_role_table("Abductees", SSticker.mode.abductees)
|
||||
|
||||
if(SSticker.mode.vampires.len)
|
||||
if(length(SSticker.mode.vampires))
|
||||
dat += check_role_table("Vampires", SSticker.mode.vampires)
|
||||
|
||||
if(SSticker.mode.vampire_enthralled.len)
|
||||
if(length(SSticker.mode.vampire_enthralled))
|
||||
dat += check_role_table("Vampire Thralls", SSticker.mode.vampire_enthralled)
|
||||
|
||||
if(SSticker.mode.xenos.len)
|
||||
if(length(SSticker.mode.xenos))
|
||||
dat += check_role_table("Xenos", SSticker.mode.xenos)
|
||||
|
||||
if(SSticker.mode.superheroes.len)
|
||||
if(length(SSticker.mode.superheroes))
|
||||
dat += check_role_table("Superheroes", SSticker.mode.superheroes)
|
||||
|
||||
if(SSticker.mode.supervillains.len)
|
||||
if(length(SSticker.mode.supervillains))
|
||||
dat += check_role_table("Supervillains", SSticker.mode.supervillains)
|
||||
|
||||
if(SSticker.mode.greyshirts.len)
|
||||
if(length(SSticker.mode.greyshirts))
|
||||
dat += check_role_table("Greyshirts", SSticker.mode.greyshirts)
|
||||
|
||||
if(SSticker.mode.eventmiscs.len)
|
||||
if(length(SSticker.mode.eventmiscs))
|
||||
dat += check_role_table("Event Roles", SSticker.mode.eventmiscs)
|
||||
|
||||
if(GLOB.ts_spiderlist.len)
|
||||
if(length(GLOB.ts_spiderlist))
|
||||
var/list/spider_minds = list()
|
||||
for(var/mob/living/simple_animal/hostile/poison/terror_spider/S in GLOB.ts_spiderlist)
|
||||
if(S.ckey)
|
||||
spider_minds += S.mind
|
||||
if(spider_minds.len)
|
||||
if(length(spider_minds))
|
||||
dat += check_role_table("Terror Spiders", spider_minds)
|
||||
|
||||
var/count_eggs = 0
|
||||
@@ -486,7 +486,7 @@
|
||||
count_infected = length(GLOB.ts_infected_list)
|
||||
dat += "<table cellspacing=5><tr><td>Growing TS on-station: [count_eggs] egg\s, [count_spiderlings] spiderling\s, [count_infected] infected</td></tr></table>"
|
||||
|
||||
if(SSticker.mode.ert.len)
|
||||
if(length(SSticker.mode.ert))
|
||||
dat += check_role_table("ERT", SSticker.mode.ert)
|
||||
|
||||
//list active security force count, so admins know how bad things are
|
||||
|
||||
+10
-10
@@ -269,7 +269,7 @@
|
||||
|
||||
else if(task == "rank")
|
||||
var/new_rank
|
||||
if(GLOB.admin_ranks.len)
|
||||
if(length(GLOB.admin_ranks))
|
||||
new_rank = input("Please select a rank", "New rank", null, null) as null|anything in (GLOB.admin_ranks|"*New Rank*")
|
||||
else
|
||||
new_rank = input("Please select a rank", "New rank", null, null) as null|anything in list("Mentor", "Trial Admin", "Game Admin", "*New Rank*")
|
||||
@@ -287,7 +287,7 @@
|
||||
to_chat(usr, "<font color='red'>Error: Topic 'editrights': Invalid rank</font>")
|
||||
return
|
||||
if(!GLOB.configuration.admin.use_database_admins)
|
||||
if(GLOB.admin_ranks.len)
|
||||
if(length(GLOB.admin_ranks))
|
||||
if(new_rank in GLOB.admin_ranks)
|
||||
rights = GLOB.admin_ranks[new_rank] //we typed a rank which already exists, use its rights
|
||||
else
|
||||
@@ -757,7 +757,7 @@
|
||||
notbannedlist += job
|
||||
|
||||
//Banning comes first
|
||||
if(notbannedlist.len) //at least 1 unbanned job exists in joblist so we have stuff to ban.
|
||||
if(length(notbannedlist)) //at least 1 unbanned job exists in joblist so we have stuff to ban.
|
||||
switch(alert("Temporary Ban of [M.ckey]?", null,"Yes","No", "Cancel"))
|
||||
if("Yes")
|
||||
var/mins = input(usr,"How long (in minutes)?","Ban time",1440) as num|null
|
||||
@@ -1991,7 +1991,7 @@
|
||||
return
|
||||
var/list/mob/dead/observer/candidates = SSghost_spawns.poll_candidates("Play as the special event pet [H]?", poll_time = 20 SECONDS, min_hours = 10, source = petchoice)
|
||||
var/mob/dead/observer/theghost = null
|
||||
if(candidates.len)
|
||||
if(length(candidates))
|
||||
var/mob/living/simple_animal/pet/P = new petchoice(H.loc)
|
||||
theghost = pick(candidates)
|
||||
P.key = theghost.key
|
||||
@@ -2148,7 +2148,7 @@
|
||||
if(player.current)
|
||||
if(ismindshielded(player.current))
|
||||
possible_traitors -= player
|
||||
if(possible_traitors.len)
|
||||
if(length(possible_traitors))
|
||||
var/datum/mind/newtraitormind = pick(possible_traitors)
|
||||
|
||||
var/datum/objective/assassinate/kill_objective = new()
|
||||
@@ -2678,9 +2678,9 @@
|
||||
|
||||
var/list/offset = splittext(href_list["offset"],",")
|
||||
var/number = dd_range(1, 100, text2num(href_list["object_count"]))
|
||||
var/X = offset.len > 0 ? text2num(offset[1]) : 0
|
||||
var/Y = offset.len > 1 ? text2num(offset[2]) : 0
|
||||
var/Z = offset.len > 2 ? text2num(offset[3]) : 0
|
||||
var/X = length(offset) > 0 ? text2num(offset[1]) : 0
|
||||
var/Y = length(offset) > 1 ? text2num(offset[2]) : 0
|
||||
var/Z = length(offset) > 2 ? text2num(offset[3]) : 0
|
||||
var/tmp_dir = href_list["object_dir"]
|
||||
var/obj_dir = tmp_dir ? text2num(tmp_dir) : 2
|
||||
if(!obj_dir || !(obj_dir in list(1,2,4,8,5,6,9,10)))
|
||||
@@ -3276,7 +3276,7 @@
|
||||
var/dat = "<b>Admin Log<hr></b>"
|
||||
for(var/l in GLOB.admin_log)
|
||||
dat += "<li>[l]</li>"
|
||||
if(!GLOB.admin_log.len)
|
||||
if(!length(GLOB.admin_log))
|
||||
dat += "No-one has done anything this round!"
|
||||
usr << browse(dat, "window=admin_log")
|
||||
if("maint_ACCESS_BRIG")
|
||||
@@ -3520,7 +3520,7 @@
|
||||
message_admins("[key_name_admin(mob)] is sending a ([dresscode]) to [killthem ? "assassinate" : "protect"] [key_name_admin(H)]...")
|
||||
var/image/source = image('icons/obj/cardboard_cutout.dmi', "cutout_traitor")
|
||||
var/list/candidates = SSghost_spawns.poll_candidates("Play as a [killthem ? "murderous" : "protective"] [dresscode]?", ROLE_TRAITOR, TRUE, source = source, role_cleanname = "[killthem ? "murderous" : "protective"] [dresscode]")
|
||||
if(!candidates.len)
|
||||
if(!length(candidates))
|
||||
to_chat(usr, "<span class='warning'>ERROR: Could not create eventmob. No valid candidates.</span>")
|
||||
return
|
||||
var/mob/C = pick(candidates)
|
||||
|
||||
@@ -32,12 +32,12 @@
|
||||
|
||||
var/list/query_list = SDQL2_tokenize(query_text)
|
||||
|
||||
if(!query_list || query_list.len < 1)
|
||||
if(!query_list || length(query_list) < 1)
|
||||
return
|
||||
|
||||
var/list/querys = SDQL_parse(query_list)
|
||||
|
||||
if(!querys || querys.len < 1)
|
||||
if(!querys || length(querys) < 1)
|
||||
return
|
||||
|
||||
var/query_log = "executed SDQL query: \"[query_text]\"."
|
||||
@@ -129,7 +129,7 @@
|
||||
var/datum/temp = d
|
||||
var/i = 0
|
||||
for(var/v in sets)
|
||||
if(++i == sets.len)
|
||||
if(++i == length(sets))
|
||||
if(isturf(temp) && (v == "x" || v == "y" || v == "z"))
|
||||
continue
|
||||
if(!temp.vv_edit_var(v, SDQL_expression(d, set_list[sets])))
|
||||
@@ -156,7 +156,7 @@
|
||||
for(var/val in query_list)
|
||||
if(val == ";")
|
||||
do_parse = 1
|
||||
else if(pos >= query_list.len)
|
||||
else if(pos >= length(query_list))
|
||||
query_tree += val
|
||||
do_parse = 1
|
||||
|
||||
@@ -164,7 +164,7 @@
|
||||
parser.query = query_tree
|
||||
var/list/parsed_tree
|
||||
parsed_tree = parser.parse()
|
||||
if(parsed_tree.len > 0)
|
||||
if(length(parsed_tree) > 0)
|
||||
querys.len = querys_pos
|
||||
querys[querys_pos] = parsed_tree
|
||||
querys_pos++
|
||||
@@ -282,7 +282,7 @@
|
||||
var/result = 0
|
||||
var/val
|
||||
|
||||
for(var/i = start, i <= expression.len, i++)
|
||||
for(var/i = start, i <= length(expression), i++)
|
||||
var/op = ""
|
||||
|
||||
if(i > start)
|
||||
@@ -337,7 +337,7 @@
|
||||
var/i = start
|
||||
var/val = null
|
||||
|
||||
if(i > expression.len)
|
||||
if(i > length(expression))
|
||||
return list("val" = null, "i" = i)
|
||||
|
||||
if(istype(expression[i], /list))
|
||||
@@ -375,14 +375,14 @@
|
||||
|
||||
else
|
||||
val = SDQL_var(object, expression, i, object)
|
||||
i = expression.len
|
||||
i = length(expression)
|
||||
|
||||
return list("val" = val, "i" = i)
|
||||
|
||||
/proc/SDQL_var(datum/object, list/expression, start = 1, source)
|
||||
var/v
|
||||
|
||||
var/long = start < expression.len
|
||||
var/long = start < length(expression)
|
||||
|
||||
if(object == world && long && expression[start + 1] == ".")
|
||||
to_chat(usr, "Sorry, but global variables are not supported at the moment.")
|
||||
@@ -431,7 +431,7 @@
|
||||
else if(expression[start + 1] == "\[" && islist(v))
|
||||
var/list/L = v
|
||||
var/index = SDQL_expression(source, expression[start + 2])
|
||||
if(isnum(index) && (!ISINTEGER(index) || L.len < index))
|
||||
if(isnum(index) && (!ISINTEGER(index) || length(L) < index))
|
||||
to_chat(world, "<span class='danger'>Invalid list index: [index]</span>")
|
||||
return null
|
||||
return L[index]
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
/datum/SDQL_parser/proc/parse_error(error_message)
|
||||
error = 1
|
||||
to_chat(usr, "<span class='danger'>SDQL2 Parsing Error: [error_message]</span>")
|
||||
return query.len + 1
|
||||
return length(query) + 1
|
||||
|
||||
/datum/SDQL_parser/proc/parse()
|
||||
tree = list()
|
||||
@@ -73,14 +73,14 @@
|
||||
return tree
|
||||
|
||||
/datum/SDQL_parser/proc/token(i)
|
||||
if(i <= query.len)
|
||||
if(i <= length(query))
|
||||
return query[i]
|
||||
|
||||
else
|
||||
return null
|
||||
|
||||
/datum/SDQL_parser/proc/tokens(i, num)
|
||||
if(i + num <= query.len)
|
||||
if(i + num <= length(query))
|
||||
return query.Copy(i, i + num)
|
||||
|
||||
else
|
||||
|
||||
@@ -47,12 +47,12 @@
|
||||
SSblackbox.record_feedback("tally", "admin_verb", 1, "Check Power") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
for(var/datum/regional_powernet/PN in SSmachines.powernets)
|
||||
if(!PN.nodes || !PN.nodes.len)
|
||||
if(PN.cables && (PN.cables.len > 1))
|
||||
if(!PN.nodes || !length(PN.nodes))
|
||||
if(PN.cables && (length(PN.cables) > 1))
|
||||
var/obj/structure/cable/C = PN.cables[1]
|
||||
to_chat(usr, "Powernet with no nodes! (number [PN.number]) - example cable at [C.x], [C.y], [C.z] in area [get_area(C.loc)]")
|
||||
|
||||
if(!PN.cables || (PN.cables.len < 10))
|
||||
if(PN.cables && (PN.cables.len > 1))
|
||||
if(!PN.cables || (length(PN.cables) < 10))
|
||||
if(PN.cables && (length(PN.cables) > 1))
|
||||
var/obj/structure/cable/C = PN.cables[1]
|
||||
to_chat(usr, "Powernet with fewer than 10 cables! (number [PN.number]) - example cable at [C.x], [C.y], [C.z] in area [get_area(C.loc)]")
|
||||
|
||||
@@ -64,13 +64,13 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
|
||||
if(!target)
|
||||
to_chat(usr, "<font color='red'>Error: callproc(): owner of proc no longer exists.</font>")
|
||||
return
|
||||
message_admins("[key_name_admin(src)] called [target]'s [procname]() with [lst.len ? "the arguments [list2params(lst)]":"no arguments"].")
|
||||
log_admin("[key_name(src)] called [target]'s [procname]() with [lst.len ? "the arguments [list2params(lst)]":"no arguments"].")
|
||||
message_admins("[key_name_admin(src)] called [target]'s [procname]() with [length(lst) ? "the arguments [list2params(lst)]":"no arguments"].")
|
||||
log_admin("[key_name(src)] called [target]'s [procname]() with [length(lst) ? "the arguments [list2params(lst)]":"no arguments"].")
|
||||
returnval = WrapAdminProcCall(target, procname, lst) // Pass the lst as an argument list to the proc
|
||||
else
|
||||
//this currently has no hascall protection. wasn't able to get it working.
|
||||
message_admins("[key_name_admin(src)] called [procname]() with [lst.len ? "the arguments [list2params(lst)]":"no arguments"]")
|
||||
log_admin("[key_name(src)] called [procname]() with [lst.len ? "the arguments [list2params(lst)]":"no arguments"]")
|
||||
message_admins("[key_name_admin(src)] called [procname]() with [length(lst) ? "the arguments [list2params(lst)]":"no arguments"]")
|
||||
log_admin("[key_name(src)] called [procname]() with [length(lst) ? "the arguments [list2params(lst)]":"no arguments"]")
|
||||
returnval = WrapAdminProcCall(GLOBAL_PROC, procname, lst) // Pass the lst as an argument list to the proc
|
||||
|
||||
to_chat(usr, "<font color='#EB4E00'>[procname] returned: [!isnull(returnval) ? returnval : "null"]</font>")
|
||||
@@ -173,8 +173,8 @@ GLOBAL_PROTECT(AdminProcCallSpamPrevention)
|
||||
if(!A || !IsValidSrc(A))
|
||||
to_chat(src, "<span class='warning'>Error: callproc_datum(): owner of proc no longer exists.</span>")
|
||||
return
|
||||
message_admins("[key_name_admin(src)] called [A]'s [procname]() with [lst.len ? "the arguments [list2params(lst)]":"no arguments"]")
|
||||
log_admin("[key_name(src)] called [A]'s [procname]() with [lst.len ? "the arguments [list2params(lst)]":"no arguments"]")
|
||||
message_admins("[key_name_admin(src)] called [A]'s [procname]() with [length(lst) ? "the arguments [list2params(lst)]":"no arguments"]")
|
||||
log_admin("[key_name(src)] called [A]'s [procname]() with [length(lst) ? "the arguments [list2params(lst)]":"no arguments"]")
|
||||
|
||||
spawn()
|
||||
var/returnval = WrapAdminProcCall(A, procname, lst) // Pass the lst as an argument list to the proc
|
||||
|
||||
@@ -92,7 +92,7 @@
|
||||
if(!f)
|
||||
output += " [filters[filter]]: ERROR<br>"
|
||||
continue
|
||||
output += " [filters[filter]]: [f.len]<br>"
|
||||
output += " [filters[filter]]: [length(f)]<br>"
|
||||
for(var/device in f)
|
||||
if(isobj(device))
|
||||
output += " [device] ([device:x],[device:y],[device:z] in area [get_area(device:loc)])<br>"
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
if(!G.client.is_afk())
|
||||
if(!(G.mind && G.mind.current && G.mind.current.stat != DEAD))
|
||||
possible_ghosts += G
|
||||
for(var/i=teamsize,(i>0&&possible_ghosts.len),i--) //Decrease with every member selected.
|
||||
for(var/i=teamsize,(i>0&&length(possible_ghosts)),i--) //Decrease with every member selected.
|
||||
var/candidate = input("Pick characters to spawn. This will go on until there either no more ghosts to pick from, or the slots are full.", "Active Players") as null|anything in possible_ghosts // auto-picks if only one candidate
|
||||
possible_ghosts -= candidate
|
||||
players_to_spawn += candidate
|
||||
@@ -55,7 +55,7 @@
|
||||
to_chat(src, "Polling candidates...")
|
||||
players_to_spawn = SSghost_spawns.poll_candidates("Do you want to play as \a [initial(O.name)]?")
|
||||
|
||||
if(!players_to_spawn.len)
|
||||
if(!length(players_to_spawn))
|
||||
to_chat(src, "Nobody volunteered.")
|
||||
return 0
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ GLOBAL_VAR_INIT(sent_syndicate_infiltration_team, 0)
|
||||
if(!G.client.is_afk())
|
||||
if(!(G.mind && G.mind.current && G.mind.current.stat != DEAD))
|
||||
possible_ghosts += G
|
||||
for(var/i=teamsize,(i>0&&possible_ghosts.len),i--) //Decrease with every SIT member selected.
|
||||
for(var/i=teamsize,(i>0&&length(possible_ghosts)),i--) //Decrease with every SIT member selected.
|
||||
var/candidate = input("Pick characters to spawn as a SIT member. This will go on until there either no more ghosts to pick from, or the slots are full.", "Active Players") as null|anything in possible_ghosts // auto-picks if only one candidate
|
||||
possible_ghosts -= candidate
|
||||
infiltrators += candidate
|
||||
@@ -58,7 +58,7 @@ GLOBAL_VAR_INIT(sent_syndicate_infiltration_team, 0)
|
||||
var/image/I = new('icons/obj/cardboard_cutout.dmi', "cutout_sit")
|
||||
infiltrators = SSghost_spawns.poll_candidates("Do you want to play as a Syndicate infiltrator?", ROLE_TRAITOR, TRUE, source = I, role_cleanname = "Syndicate infiltrator")
|
||||
|
||||
if(!infiltrators.len)
|
||||
if(!length(infiltrators))
|
||||
to_chat(src, "Nobody volunteered.")
|
||||
return 0
|
||||
|
||||
@@ -76,10 +76,10 @@ GLOBAL_VAR_INIT(sent_syndicate_infiltration_team, 0)
|
||||
var/num_spawned = 1
|
||||
var/team_leader = null
|
||||
for(var/obj/effect/landmark/L in sit_spawns)
|
||||
if(!infiltrators.len && !spawn_dummies) break
|
||||
if(!length(infiltrators) && !spawn_dummies) break
|
||||
syndicate_leader_selected = num_spawned == 1?1:0
|
||||
var/mob/living/carbon/human/new_syndicate_infiltrator = create_syndicate_infiltrator(L, syndicate_leader_selected, tcamount, 0)
|
||||
if(infiltrators.len)
|
||||
if(length(infiltrators))
|
||||
var/mob/theguy = pick(infiltrators)
|
||||
if(theguy.key != key)
|
||||
new_syndicate_infiltrator.key = theguy.key
|
||||
|
||||
@@ -14,7 +14,7 @@ GLOBAL_LIST_EMPTY(open_logging_views)
|
||||
else if(clear_view)
|
||||
cur_view.clear_all()
|
||||
|
||||
if(mobs_to_add?.len)
|
||||
if(length(mobs_to_add))
|
||||
cur_view.add_mobs(mobs_to_add)
|
||||
|
||||
cur_view.show_ui(usr)
|
||||
|
||||
@@ -111,7 +111,7 @@
|
||||
if(VV_RESTORE_DEFAULT)
|
||||
to_chat(src, "Finding items...")
|
||||
var/list/items = get_all_of_type(O.type, method)
|
||||
to_chat(src, "Changing [items.len] items...")
|
||||
to_chat(src, "Changing [length(items)] items...")
|
||||
for(var/thing in items)
|
||||
if(!thing)
|
||||
continue
|
||||
@@ -126,7 +126,7 @@
|
||||
var/list/varsvars = vv_parse_text(O, new_value)
|
||||
var/pre_processing = new_value
|
||||
var/unique
|
||||
if(varsvars && varsvars.len)
|
||||
if(varsvars && length(varsvars))
|
||||
unique = alert(usr, "Process vars unique to each instance, or same for all?", "Variable Association", "Unique", "Same")
|
||||
if(unique == "Unique")
|
||||
unique = TRUE
|
||||
@@ -137,7 +137,7 @@
|
||||
|
||||
to_chat(src, "Finding items...")
|
||||
var/list/items = get_all_of_type(O.type, method)
|
||||
to_chat(src, "Changing [items.len] items...")
|
||||
to_chat(src, "Changing [length(items)] items...")
|
||||
for(var/thing in items)
|
||||
if(!thing)
|
||||
continue
|
||||
@@ -165,7 +165,7 @@
|
||||
var/type = value["type"]
|
||||
to_chat(src, "Finding items...")
|
||||
var/list/items = get_all_of_type(O.type, method)
|
||||
to_chat(src, "Changing [items.len] items...")
|
||||
to_chat(src, "Changing [length(items)] items...")
|
||||
for(var/thing in items)
|
||||
if(!thing)
|
||||
continue
|
||||
@@ -183,7 +183,7 @@
|
||||
else
|
||||
to_chat(src, "Finding items...")
|
||||
var/list/items = get_all_of_type(O.type, method)
|
||||
to_chat(src, "Changing [items.len] items...")
|
||||
to_chat(src, "Changing [length(items)] items...")
|
||||
for(var/thing in items)
|
||||
if(!thing)
|
||||
continue
|
||||
|
||||
@@ -282,9 +282,9 @@ GLOBAL_PROTECT(VVmaint_only)
|
||||
if(!ispath(type))
|
||||
return
|
||||
var/list/subtypes = subtypesof(type)
|
||||
if(!subtypes || !subtypes.len)
|
||||
if(!subtypes || !length(subtypes))
|
||||
return FALSE
|
||||
if(subtypes && subtypes.len)
|
||||
if(subtypes && length(subtypes))
|
||||
switch(alert("Strict object type detection?", "Type detection", "Strictly this type","This type and subtypes", "Cancel"))
|
||||
if("Strictly this type")
|
||||
return FALSE
|
||||
@@ -374,7 +374,7 @@ GLOBAL_PROTECT(VVmaint_only)
|
||||
to_chat(src, "Not a List.")
|
||||
return
|
||||
|
||||
if(L.len > 1000)
|
||||
if(length(L) > 1000)
|
||||
var/confirm = alert(src, "The list you're trying to edit is very long, continuing may crash the server.", "Warning", "Continue", "Abort")
|
||||
if(confirm != "Continue")
|
||||
return
|
||||
@@ -382,7 +382,7 @@ GLOBAL_PROTECT(VVmaint_only)
|
||||
|
||||
|
||||
var/list/names = list()
|
||||
for(var/i in 1 to L.len)
|
||||
for(var/i in 1 to length(L))
|
||||
var/key = L[i]
|
||||
var/value
|
||||
if(IS_NORMAL_LIST(L) && !isnum(key))
|
||||
|
||||
@@ -60,8 +60,8 @@
|
||||
if(CandCheck(ROLE_TRAITOR, applicant, temp))
|
||||
candidates += applicant
|
||||
|
||||
if(candidates.len)
|
||||
var/numTraitors = min(candidates.len, antnum)
|
||||
if(length(candidates))
|
||||
var/numTraitors = min(length(candidates), antnum)
|
||||
|
||||
for(var/i = 0, i<numTraitors, i++)
|
||||
H = pick(candidates)
|
||||
@@ -91,8 +91,8 @@
|
||||
if(CandCheck(ROLE_CHANGELING, applicant, temp))
|
||||
candidates += applicant
|
||||
|
||||
if(candidates.len)
|
||||
var/numChangelings = min(candidates.len, antnum)
|
||||
if(length(candidates))
|
||||
var/numChangelings = min(length(candidates), antnum)
|
||||
|
||||
for(var/i = 0, i<numChangelings, i++)
|
||||
H = pick(candidates)
|
||||
@@ -121,8 +121,8 @@
|
||||
if(CandCheck(ROLE_REV, applicant, temp))
|
||||
candidates += applicant
|
||||
|
||||
if(candidates.len)
|
||||
var/numRevs = min(candidates.len, antnum)
|
||||
if(length(candidates))
|
||||
var/numRevs = min(length(candidates), antnum)
|
||||
|
||||
for(var/i = 0, i<numRevs, i++)
|
||||
H = pick(candidates)
|
||||
@@ -142,7 +142,7 @@
|
||||
log_admin("[key_name(owner)] tried making a Wizard with One-Click-Antag")
|
||||
message_admins("[key_name_admin(owner)] tried making a Wizard with One-Click-Antag")
|
||||
|
||||
if(candidates.len)
|
||||
if(length(candidates))
|
||||
var/mob/dead/observer/selected = pick(candidates)
|
||||
candidates -= selected
|
||||
|
||||
@@ -276,8 +276,8 @@
|
||||
if(CandCheck(ROLE_VAMPIRE, applicant, temp))
|
||||
candidates += applicant
|
||||
|
||||
if(candidates.len)
|
||||
var/numVampires = min(candidates.len, antnum)
|
||||
if(length(candidates))
|
||||
var/numVampires = min(length(candidates), antnum)
|
||||
|
||||
for(var/i = 0, i<numVampires, i++)
|
||||
H = pick(candidates)
|
||||
|
||||
@@ -368,7 +368,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
|
||||
if(G_found.mind.assigned_role=="Alien")
|
||||
if(alert("This character appears to have been an alien. Would you like to respawn them as such?", null,"Yes","No")=="Yes")
|
||||
var/turf/T
|
||||
if(GLOB.xeno_spawn.len) T = pick(GLOB.xeno_spawn)
|
||||
if(length(GLOB.xeno_spawn)) T = pick(GLOB.xeno_spawn)
|
||||
else T = pick(GLOB.latejoin)
|
||||
|
||||
var/mob/living/carbon/alien/new_xeno
|
||||
@@ -519,14 +519,14 @@ Traitors and the like can also be revived with the previous role mostly intact.
|
||||
if(M.mind && M.mind.current && M.mind.current.stat != DEAD)
|
||||
continue //we have a live body we are tied to
|
||||
candidates += M.ckey
|
||||
if(candidates.len)
|
||||
if(length(candidates))
|
||||
ckey = input("Pick the player you want to respawn as a xeno.", "Suitable Candidates") as null|anything in candidates
|
||||
else
|
||||
to_chat(usr, "<font color='red'>Error: create_xeno(): no suitable candidates.</font>")
|
||||
if(!istext(ckey)) return 0
|
||||
|
||||
var/alien_caste = input(usr, "Please choose which caste to spawn.","Pick a caste",null) as null|anything in list("Queen","Hunter","Sentinel","Drone","Larva")
|
||||
var/obj/effect/landmark/spawn_here = GLOB.xeno_spawn.len ? pick(GLOB.xeno_spawn) : pick(GLOB.latejoin)
|
||||
var/obj/effect/landmark/spawn_here = length(GLOB.xeno_spawn) ? pick(GLOB.xeno_spawn) : pick(GLOB.latejoin)
|
||||
var/mob/living/carbon/alien/new_xeno
|
||||
switch(alien_caste)
|
||||
if("Queen") new_xeno = new /mob/living/carbon/alien/humanoid/queen/large(spawn_here)
|
||||
|
||||
Reference in New Issue
Block a user