mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-23 03:57:13 +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
@@ -45,7 +45,7 @@ GLOBAL_LIST_EMPTY(field_generator_fields)
|
||||
. = ..()
|
||||
if(warming_up)
|
||||
. += "+a[warming_up]"
|
||||
if(fields.len)
|
||||
if(length(fields))
|
||||
. += "+on"
|
||||
if(power_level)
|
||||
. += "+p[power_level]"
|
||||
@@ -182,7 +182,7 @@ GLOBAL_LIST_EMPTY(field_generator_fields)
|
||||
|
||||
|
||||
/obj/machinery/field/generator/proc/calc_power()
|
||||
var/power_draw = 2 + fields.len
|
||||
var/power_draw = 2 + length(fields)
|
||||
|
||||
if(draw_power(round(power_draw/2, 1)))
|
||||
check_power_level()
|
||||
@@ -333,11 +333,11 @@ GLOBAL_LIST_EMPTY(field_generator_fields)
|
||||
O.last_warning = world.time
|
||||
|
||||
/obj/machinery/field/generator/shock_field(mob/living/user)
|
||||
if(fields.len)
|
||||
if(length(fields))
|
||||
..()
|
||||
|
||||
/obj/machinery/field/generator/bump_field(atom/movable/AM as mob|obj)
|
||||
if(fields.len)
|
||||
if(length(fields))
|
||||
..()
|
||||
|
||||
#undef FG_UNSECURED
|
||||
|
||||
@@ -385,13 +385,13 @@
|
||||
/obj/machinery/power/solar_control/ui_data(mob/user)
|
||||
var/list/data = list()
|
||||
data["generated"] = round(lastgen) //generated power by all connected panels
|
||||
data["generated_ratio"] = data["generated"] / round(max(connected_panels.len, 1) * SSsun.solar_gen_rate) //power generation ratio. Used for the power bar
|
||||
data["generated_ratio"] = data["generated"] / round(max(length(connected_panels), 1) * SSsun.solar_gen_rate) //power generation ratio. Used for the power bar
|
||||
data["direction"] = angle2text(cdir) //current orientation of the panels
|
||||
data["cdir"] = cdir //current orientation of the of the panels in degrees
|
||||
data["tracking_state"] = track //tracker status: TRACKER_OFF, TRACKER_TIMED, TRACKER_AUTO
|
||||
data["tracking_rate"] = trackrate //rotation speed of tracker in degrees/h
|
||||
data["rotating_direction"] = (trackrate < 0 ? "Counter clockwise" : "Clockwise") //direction of tracker
|
||||
data["connected_panels"] = connected_panels.len
|
||||
data["connected_panels"] = length(connected_panels)
|
||||
data["connected_tracker"] = (connected_tracker ? TRUE : FALSE)
|
||||
return data
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
return
|
||||
|
||||
//We assume net1 is larger. If net2 is in fact larger we are just going to make them switch places to reduce on code.
|
||||
if(net1.cables.len < net2.cables.len) //net2 is larger than net1. Let's switch them around
|
||||
if(length(net1.cables) < length(net2.cables)) //net2 is larger than net1. Let's switch them around
|
||||
var/temp = net1
|
||||
net1 = net2
|
||||
net2 = temp
|
||||
|
||||
Reference in New Issue
Block a user