mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-20 19:44:09 +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:
@@ -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()
|
||||
@@ -241,7 +241,7 @@
|
||||
lookup[sig] -= src
|
||||
|
||||
signal_procs[target] -= sig_type_or_types
|
||||
if(!signal_procs[target].len)
|
||||
if(!length(signal_procs[target]))
|
||||
signal_procs -= target
|
||||
|
||||
/// Registers multiple signals to the same proc.
|
||||
|
||||
@@ -184,7 +184,7 @@
|
||||
//For consuming material
|
||||
//mats is a list of types of material to use and the corresponding amounts, example: list(MAT_METAL=100, MAT_GLASS=200)
|
||||
/datum/component/material_container/proc/use_amount(list/mats, multiplier=1)
|
||||
if(!mats || !mats.len)
|
||||
if(!mats || !length(mats))
|
||||
return FALSE
|
||||
|
||||
var/datum/material/M
|
||||
@@ -292,7 +292,7 @@
|
||||
return (total_amount + amt) <= max_amount
|
||||
|
||||
/datum/component/material_container/proc/has_materials(list/mats, multiplier=1)
|
||||
if(!mats || !mats.len)
|
||||
if(!mats || !length(mats))
|
||||
return FALSE
|
||||
|
||||
var/datum/material/M
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
|
||||
/datum/component/spawner/proc/try_spawn_mob()
|
||||
var/atom/P = parent
|
||||
if(spawned_mobs.len >= max_mobs)
|
||||
if(length(spawned_mobs) >= max_mobs)
|
||||
return 0
|
||||
if(spawn_delay > world.time)
|
||||
return 0
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
for(var/other in swarm_members)
|
||||
var/datum/component/swarming/other_swarm = other
|
||||
other_swarm.swarm_members -= src
|
||||
if(!other_swarm.swarm_members.len)
|
||||
if(!length(other_swarm.swarm_members))
|
||||
other_swarm.unswarm()
|
||||
swarm_members = null
|
||||
return ..()
|
||||
@@ -36,10 +36,10 @@
|
||||
if(!other_swarm || !(other_swarm in swarm_members))
|
||||
return
|
||||
swarm_members -= other_swarm
|
||||
if(!swarm_members.len)
|
||||
if(!length(swarm_members))
|
||||
unswarm()
|
||||
other_swarm.swarm_members -= src
|
||||
if(!other_swarm.swarm_members.len)
|
||||
if(!length(other_swarm.swarm_members))
|
||||
other_swarm.unswarm()
|
||||
|
||||
/datum/component/swarming/proc/swarm()
|
||||
|
||||
Reference in New Issue
Block a user