mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-22 19:47:22 +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:
co-authored by
Deniz
FunnyMan3595
parent
bdd417ada0
commit
bad8b31afa
@@ -54,7 +54,7 @@
|
||||
return
|
||||
|
||||
var/list/cardaccess = W:access
|
||||
if(!istype(cardaccess, /list) || !cardaccess.len) //no access
|
||||
if(!istype(cardaccess, /list) || !length(cardaccess)) //no access
|
||||
to_chat(user, "The access level of [W:registered_name]\'s card is not high enough. ")
|
||||
return
|
||||
|
||||
@@ -74,10 +74,10 @@
|
||||
if("Authorize")
|
||||
if(!authorized.Find(W:registered_name))
|
||||
authorized += W:registered_name
|
||||
if(auth_need - authorized.len > 0)
|
||||
if(auth_need - length(authorized) > 0)
|
||||
message_admins("[key_name_admin(user)] has authorized early shuttle launch.")
|
||||
log_game("[key_name(user)] has authorized early shuttle launch in ([x], [y], [z]).")
|
||||
GLOB.minor_announcement.Announce("[auth_need - authorized.len] more authorization(s) needed until shuttle is launched early")
|
||||
GLOB.minor_announcement.Announce("[auth_need - length(authorized)] more authorization(s) needed until shuttle is launched early")
|
||||
else
|
||||
message_admins("[key_name_admin(user)] has launched the emergency shuttle [seconds] seconds before launch.")
|
||||
log_game("[key_name(user)] has launched the emergency shuttle in ([x], [y], [z]) [seconds] seconds before launch.")
|
||||
@@ -86,10 +86,10 @@
|
||||
|
||||
if("Repeal")
|
||||
if(authorized.Remove(W:registered_name))
|
||||
GLOB.minor_announcement.Announce("[auth_need - authorized.len] authorizations needed until shuttle is launched early")
|
||||
GLOB.minor_announcement.Announce("[auth_need - length(authorized)] authorizations needed until shuttle is launched early")
|
||||
|
||||
if("Abort")
|
||||
if(authorized.len)
|
||||
if(length(authorized))
|
||||
GLOB.minor_announcement.Announce("All authorizations to launch the shuttle early have been revoked.")
|
||||
authorized.Cut()
|
||||
|
||||
@@ -341,7 +341,7 @@
|
||||
|
||||
// The emergency shuttle doesn't work like others so this
|
||||
// ripple check is slightly different
|
||||
if(!ripples.len && (time_left <= SHUTTLE_RIPPLE_TIME) && ((mode == SHUTTLE_CALL) || (mode == SHUTTLE_ESCAPE)))
|
||||
if(!length(ripples) && (time_left <= SHUTTLE_RIPPLE_TIME) && ((mode == SHUTTLE_CALL) || (mode == SHUTTLE_ESCAPE)))
|
||||
var/destination
|
||||
if(mode == SHUTTLE_CALL)
|
||||
destination = SSshuttle.getDock("emergency_home")
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
return ..()
|
||||
|
||||
/obj/machinery/computer/camera_advanced/shuttle_docker/GrantActions(mob/living/user)
|
||||
if(jumpto_ports.len)
|
||||
if(length(jumpto_ports))
|
||||
jump_action = new /datum/action/innate/camera_jump/shuttle_docker
|
||||
..()
|
||||
if(place_action)
|
||||
@@ -165,7 +165,7 @@
|
||||
var/mob/camera/aiEye/remote/shuttle_docker/the_eye = eyeobj
|
||||
var/list/image_cache = the_eye.placement_images
|
||||
the_eye.setDir(turn(the_eye.dir, -90))
|
||||
for(var/i in 1 to image_cache.len)
|
||||
for(var/i in 1 to length(image_cache))
|
||||
var/image/pic = image_cache[i]
|
||||
var/list/coords = image_cache[pic]
|
||||
var/Tmp = coords[1]
|
||||
@@ -187,7 +187,7 @@
|
||||
var/list/bounds = shuttle_port.return_coords(the_eye.x - x_offset, the_eye.y - y_offset, the_eye.dir)
|
||||
var/list/overlappers = SSshuttle.get_dock_overlap(bounds[1], bounds[2], bounds[3], bounds[4], the_eye.z)
|
||||
var/list/image_cache = the_eye.placement_images
|
||||
for(var/i in 1 to image_cache.len)
|
||||
for(var/i in 1 to length(image_cache))
|
||||
var/image/I = image_cache[i]
|
||||
var/list/coords = image_cache[I]
|
||||
var/turf/T = locate(eyeturf.x + coords[1], eyeturf.y + coords[2], eyeturf.z)
|
||||
@@ -227,7 +227,7 @@
|
||||
return SHUTTLE_DOCKER_BLOCKED
|
||||
|
||||
// Checking for overlapping dock boundaries
|
||||
for(var/i in 1 to overlappers.len)
|
||||
for(var/i in 1 to length(overlappers))
|
||||
var/obj/docking_port/port = overlappers[i]
|
||||
if(port == my_port || locate(port) in jumpto_ports)
|
||||
continue
|
||||
|
||||
@@ -173,9 +173,9 @@
|
||||
|
||||
SSshuttle.stationary += src
|
||||
if(!id)
|
||||
id = "[SSshuttle.stationary.len]"
|
||||
id = "[length(SSshuttle.stationary)]"
|
||||
if(name == "dock")
|
||||
name = "dock[SSshuttle.stationary.len]"
|
||||
name = "dock[length(SSshuttle.stationary)]"
|
||||
|
||||
#ifdef DOCKING_PORT_HIGHLIGHT
|
||||
highlight("#f00")
|
||||
@@ -254,7 +254,7 @@
|
||||
register()
|
||||
shuttle_areas = list()
|
||||
var/list/all_turfs = return_ordered_turfs(x, y, z, dir)
|
||||
for(var/i in 1 to all_turfs.len)
|
||||
for(var/i in 1 to length(all_turfs))
|
||||
var/turf/curT = all_turfs[i]
|
||||
var/area/cur_area = curT.loc
|
||||
if(istype(cur_area, areaInstance))
|
||||
@@ -267,9 +267,9 @@
|
||||
SSshuttle.mobile += src
|
||||
|
||||
if(!id)
|
||||
id = "[SSshuttle.mobile.len]"
|
||||
id = "[length(SSshuttle.mobile)]"
|
||||
if(name == "shuttle")
|
||||
name = "shuttle[SSshuttle.mobile.len]"
|
||||
name = "shuttle[length(SSshuttle.mobile)]"
|
||||
|
||||
return 1
|
||||
|
||||
@@ -393,7 +393,7 @@
|
||||
var/list/L0 = return_ordered_turfs(x, y, z, dir, areaInstance)
|
||||
|
||||
//remove area surrounding docking port
|
||||
if(areaInstance.contents.len)
|
||||
if(length(areaInstance.contents))
|
||||
var/area/A0 = locate("[area_type]")
|
||||
if(!A0)
|
||||
A0 = new area_type(null)
|
||||
@@ -414,7 +414,7 @@
|
||||
ripples += new /obj/effect/temp_visual/ripple(i)
|
||||
|
||||
/obj/docking_port/mobile/proc/remove_ripples()
|
||||
if(ripples.len)
|
||||
if(length(ripples))
|
||||
for(var/i in ripples)
|
||||
qdel(i)
|
||||
ripples.Cut()
|
||||
@@ -426,7 +426,7 @@
|
||||
|
||||
var/list/ripple_turfs = list()
|
||||
|
||||
for(var/i in 1 to L0.len)
|
||||
for(var/i in 1 to length(L0))
|
||||
var/turf/T0 = L0[i]
|
||||
if(!T0)
|
||||
continue
|
||||
@@ -474,7 +474,7 @@
|
||||
rotation = SIMPLIFY_DEGREES(rotation)
|
||||
|
||||
//remove area surrounding docking port
|
||||
if(areaInstance.contents.len)
|
||||
if(length(areaInstance.contents))
|
||||
var/area/A0 = locate("[area_type]")
|
||||
if(!A0)
|
||||
A0 = new area_type(null)
|
||||
@@ -487,7 +487,7 @@
|
||||
//move or squish anything in the way ship at destination
|
||||
roadkill(L0, L1, S1.dir)
|
||||
|
||||
for(var/i in 1 to L0.len)
|
||||
for(var/i in 1 to length(L0))
|
||||
var/turf/T0 = L0[i]
|
||||
if(!T0)
|
||||
continue
|
||||
@@ -610,7 +610,7 @@
|
||||
A.unlock()
|
||||
|
||||
/obj/docking_port/mobile/proc/roadkill(list/L0, list/L1, dir)
|
||||
for(var/i in 1 to L0.len)
|
||||
for(var/i in 1 to length(L0))
|
||||
var/turf/T0 = L0[i]
|
||||
var/turf/T1 = L1[i]
|
||||
if(!T0 || !T1)
|
||||
@@ -667,7 +667,7 @@
|
||||
destination = null
|
||||
|
||||
/obj/docking_port/mobile/proc/check_effects()
|
||||
if(!ripples.len)
|
||||
if(!length(ripples))
|
||||
if((mode == SHUTTLE_CALL) || (mode == SHUTTLE_RECALL))
|
||||
var/tl = timeLeft(1)
|
||||
if(tl <= SHUTTLE_RIPPLE_TIME)
|
||||
@@ -835,7 +835,7 @@
|
||||
if(!M.check_dock(S))
|
||||
continue
|
||||
docking_ports[++docking_ports.len] = list("name" = S.name, "id" = S.id)
|
||||
data["docking_ports_len"] = docking_ports.len
|
||||
data["docking_ports_len"] = length(docking_ports)
|
||||
data["admin_controlled"] = admin_controlled
|
||||
return data
|
||||
|
||||
@@ -989,11 +989,11 @@
|
||||
/turf/proc/copyTurf(turf/T)
|
||||
if(T.type != type)
|
||||
var/obj/O
|
||||
if(underlays.len) //we have underlays, which implies some sort of transparency, so we want to a snapshot of the previous turf as an underlay
|
||||
if(length(underlays)) //we have underlays, which implies some sort of transparency, so we want to a snapshot of the previous turf as an underlay
|
||||
O = new()
|
||||
O.underlays.Add(T)
|
||||
T.ChangeTurf(type, keep_icon = FALSE)
|
||||
if(underlays.len)
|
||||
if(length(underlays))
|
||||
T.underlays = O.underlays
|
||||
if(T.icon_state != icon_state)
|
||||
T.icon_state = icon_state
|
||||
|
||||
Reference in New Issue
Block a user