mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-22 11:37:40 +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
@@ -46,7 +46,7 @@
|
||||
/datum/data/pda/proc/unnotify()
|
||||
if(src in pda.notifying_programs)
|
||||
pda.notifying_programs -= src
|
||||
if(!pda.notifying_programs.len)
|
||||
if(!length(pda.notifying_programs))
|
||||
pda.update_icon(UPDATE_OVERLAYS)
|
||||
|
||||
// An app has a button on the home screen and its own UI
|
||||
|
||||
@@ -313,7 +313,7 @@
|
||||
var/area/our_area = get_area(B)
|
||||
mulebotsData[++mulebotsData.len] = list("Name" = sanitize(B.name), "Location" = our_area.name, "uid" = "[B.UID()]")
|
||||
|
||||
if(!mulebotsData.len)
|
||||
if(!length(mulebotsData))
|
||||
mulebotsData[++mulebotsData.len] = list("Name" = "No bots found", "Location" = "Invalid", "uid"= null)
|
||||
|
||||
muleData["bots"] = mulebotsData
|
||||
@@ -378,7 +378,7 @@
|
||||
supplyOrderCount++
|
||||
supplyOrderData[++supplyOrderData.len] = list("Number" = SO.ordernum, "Name" = html_encode(SO.object.name), "ApprovedBy" = SO.orderedby, "Comment" = html_encode(SO.comment))
|
||||
|
||||
if(!supplyOrderData.len)
|
||||
if(!length(supplyOrderData))
|
||||
supplyOrderData[++supplyOrderData.len] = list("Number" = null, "Name" = null, "OrderedBy"=null)
|
||||
|
||||
supplyData["approved"] = supplyOrderData
|
||||
@@ -391,7 +391,7 @@
|
||||
requestCount++
|
||||
requestData[++requestData.len] = list("Number" = SO.ordernum, "Name" = html_encode(SO.object.name), "OrderedBy" = SO.orderedby, "Comment" = html_encode(SO.comment))
|
||||
|
||||
if(!requestData.len)
|
||||
if(!length(requestData))
|
||||
requestData[++requestData.len] = list("Number" = null, "Name" = null, "orderedBy" = null, "Comment" = null)
|
||||
|
||||
supplyData["requests"] = requestData
|
||||
@@ -460,10 +460,10 @@
|
||||
var/direction_from_user = get_dir(pda, janicart)
|
||||
JaniCartData[++JaniCartData.len] = list("x" = janicart_loc.x, "y" = janicart_loc.y, "direction_from_user" = uppertext(dir2text(direction_from_user)))
|
||||
|
||||
JaniData["mops"] = MopData.len ? MopData : null
|
||||
JaniData["buckets"] = BucketData.len ? BucketData : null
|
||||
JaniData["cleanbots"] = CbotData.len ? CbotData : null
|
||||
JaniData["carts"] = CartData.len ? CartData : null
|
||||
JaniData["janicarts"] = JaniCartData.len ? JaniCartData : null
|
||||
JaniData["mops"] = length(MopData) ? MopData : null
|
||||
JaniData["buckets"] = length(BucketData) ? BucketData : null
|
||||
JaniData["cleanbots"] = length(CbotData) ? CbotData : null
|
||||
JaniData["carts"] = length(CartData) ? CartData : null
|
||||
JaniData["janicarts"] = length(JaniCartData) ? JaniCartData : null
|
||||
data["janitor"] = JaniData
|
||||
|
||||
|
||||
@@ -96,16 +96,16 @@
|
||||
data["connected"] = 1
|
||||
data["wild_captures"] = wild_captures
|
||||
data["no_collection"] = 0
|
||||
if(!my_collection.len)
|
||||
if(!length(my_collection))
|
||||
data["no_collection"] = 1
|
||||
return
|
||||
var/datum/mob_hunt/mob_info
|
||||
if(!current_index)
|
||||
current_index = 1
|
||||
if(current_index > my_collection.len)
|
||||
if(current_index > length(my_collection))
|
||||
current_index = 1
|
||||
if(current_index < 1)
|
||||
current_index = my_collection.len
|
||||
current_index = length(my_collection)
|
||||
mob_info = my_collection[current_index]
|
||||
var/list/entry = list(
|
||||
"nickname" = mob_info.nickname,
|
||||
@@ -121,7 +121,7 @@
|
||||
data["entry"] = entry
|
||||
|
||||
/datum/data/pda/app/mob_hunter_game/proc/assign_nickname()
|
||||
if(!my_collection.len)
|
||||
if(!length(my_collection))
|
||||
return
|
||||
var/datum/mob_hunt/mob_info = my_collection[current_index]
|
||||
var/old_name = mob_info.mob_name
|
||||
@@ -130,13 +130,13 @@
|
||||
mob_info.nickname = tgui_input_text(usr, "Give a nickname to [old_name]?", "Nickname", old_name)
|
||||
|
||||
/datum/data/pda/app/mob_hunter_game/proc/release()
|
||||
if(!my_collection.len)
|
||||
if(!length(my_collection))
|
||||
return
|
||||
if(tgui_alert(usr, "Are you sure you want to release this mob back into the wild?", "Confirm Release", list("Yes", "No")) == "Yes")
|
||||
remove_mob()
|
||||
|
||||
/datum/data/pda/app/mob_hunter_game/proc/print_card()
|
||||
if(!pda || !my_collection.len)
|
||||
if(!pda || !length(my_collection))
|
||||
return
|
||||
var/obj/item/nanomob_card/card = new/obj/item/nanomob_card(null)
|
||||
var/datum/mob_hunt/mob_info = my_collection[current_index]
|
||||
@@ -168,7 +168,7 @@
|
||||
current_index = collection_length
|
||||
|
||||
/datum/data/pda/app/mob_hunter_game/proc/set_trap()
|
||||
if(!my_collection.len || !pda || !hacked)
|
||||
if(!length(my_collection) || !pda || !hacked)
|
||||
return
|
||||
var/datum/mob_hunt/bait = my_collection[current_index]
|
||||
bait = bait.type
|
||||
@@ -189,12 +189,12 @@
|
||||
release()
|
||||
if("Next")
|
||||
current_index++
|
||||
if(current_index > my_collection.len)
|
||||
if(current_index > length(my_collection))
|
||||
current_index = 1
|
||||
if("Prev")
|
||||
current_index--
|
||||
if(current_index < 1)
|
||||
current_index = my_collection.len
|
||||
current_index = length(my_collection)
|
||||
if("Reconnect")
|
||||
reconnect()
|
||||
if("Disconnect")
|
||||
|
||||
@@ -107,8 +107,8 @@
|
||||
/datum/data/pda/utility/scanmode/reagent/scan_atom(atom/A as mob|obj|turf|area, mob/user as mob)
|
||||
var/list/messages = list()
|
||||
if(!isnull(A.reagents))
|
||||
if(A.reagents.reagent_list.len > 0)
|
||||
var/reagents_length = A.reagents.reagent_list.len
|
||||
if(length(A.reagents.reagent_list) > 0)
|
||||
var/reagents_length = length(A.reagents.reagent_list)
|
||||
messages.Add("<span class='notice'>[reagents_length] chemical agent[reagents_length > 1 ? "s" : ""] found.</span>")
|
||||
for(var/datum/reagent/R in A.reagents.reagent_list)
|
||||
if(R.id != "blood")
|
||||
|
||||
Reference in New Issue
Block a user