mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-19 02:54:41 +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:
+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)
|
||||
|
||||
Reference in New Issue
Block a user