diff --git a/code/__DEFINES/typeids.dm b/code/__DEFINES/typeids.dm index 4fd2c390fa7..16b6e475b8e 100644 --- a/code/__DEFINES/typeids.dm +++ b/code/__DEFINES/typeids.dm @@ -2,5 +2,5 @@ #define TYPEID_NULL "0" #define TYPEID_NORMAL_LIST "f" //helper macros -#define GET_TYPEID(ref) ( ( (lentext(ref) <= 10) ? "TYPEID_NULL" : copytext(ref, 4, lentext(ref) - 6) ) ) +#define GET_TYPEID(ref) ( ( (length(ref) <= 10) ? "TYPEID_NULL" : copytext(ref, 4, length(ref) - 6) ) ) #define IS_NORMAL_LIST(L) (GET_TYPEID("\ref[L]") == TYPEID_NORMAL_LIST) \ No newline at end of file diff --git a/code/__HELPERS/text.dm b/code/__HELPERS/text.dm index f3b76064517..0f356aa4f4a 100644 --- a/code/__HELPERS/text.dm +++ b/code/__HELPERS/text.dm @@ -20,7 +20,7 @@ if(!istext(t)) t = "[t]" // Just quietly assume any non-texts are supposed to be text var/sqltext = dbcon.Quote(t); - return copytext(sqltext, 2, lentext(sqltext));//Quote() adds quotes around input, we already do that + return copytext(sqltext, 2, length(sqltext));//Quote() adds quotes around input, we already do that /proc/format_table_name(table as text) return sqlfdbktableprefix + table @@ -333,9 +333,9 @@ proc/checkhtml(var/t) //is in the other string at the same spot (assuming it is not a replace char). //This is used for fingerprints var/newtext = text - if(lentext(text) != lentext(compare)) + if(length(text) != length(compare)) return 0 - for(var/i = 1, i < lentext(text), i++) + for(var/i = 1, i < length(text), i++) var/a = copytext(text,i,i+1) var/b = copytext(compare,i,i+1) //if it isn't both the same letter, or if they are both the replacement character @@ -355,7 +355,7 @@ proc/checkhtml(var/t) if(!text || !character) return 0 var/count = 0 - for(var/i = 1, i <= lentext(text), i++) + for(var/i = 1, i <= length(text), i++) var/a = copytext(text,i,i+1) if(a == character) count++ @@ -400,8 +400,8 @@ proc/checkhtml(var/t) //Used in preferences' SetFlavorText and human's set_flavor verb //Previews a string of len or less length /proc/TextPreview(var/string,var/len=40) - if(lentext(string) <= len) - if(!lentext(string)) + if(length(string) <= len) + if(!length(string)) return "\[...\]" else return html_encode(string) //NO DECODED HTML YOU CHUCKLEFUCKS @@ -541,7 +541,7 @@ proc/checkhtml(var/t) text = "[text]" else text = "[text]" - + text = copytext(text, 1, MAX_PAPER_MESSAGE_LEN) return text diff --git a/code/game/machinery/doors/brigdoors.dm b/code/game/machinery/doors/brigdoors.dm index f23734a0079..8bd7af5dad4 100644 --- a/code/game/machinery/doors/brigdoors.dm +++ b/code/game/machinery/doors/brigdoors.dm @@ -444,7 +444,7 @@ //Stolen from status_display /obj/machinery/door_timer/proc/texticon(tn, px = 0, py = 0) var/image/I = image('icons/obj/status_display.dmi', "blank") - var/len = lentext(tn) + var/len = length(tn) for(var/d = 1 to len) var/char = copytext(tn, len-d+1, len-d+2) diff --git a/code/game/machinery/supply_display.dm b/code/game/machinery/supply_display.dm index d08f68b2914..1fe7ee6e4cb 100644 --- a/code/game/machinery/supply_display.dm +++ b/code/game/machinery/supply_display.dm @@ -14,7 +14,7 @@ else message1 = "CARGO" message2 = SSshuttle.supply.getTimerStr() - if(lentext(message2) > CHARS_PER_LINE) + if(length(message2) > CHARS_PER_LINE) message2 = "Error" update_display(message1, message2) diff --git a/code/game/objects/structures/musician.dm b/code/game/objects/structures/musician.dm index 274645933b2..da3ec759d36 100644 --- a/code/game/objects/structures/musician.dm +++ b/code/game/objects/structures/musician.dm @@ -88,12 +88,12 @@ if(!playing || shouldStopPlaying(user)) //If the instrument is playing, or special case playing = 0 return - if(lentext(note) == 0) + if(length(note) == 0) continue var/cur_note = text2ascii(note) - 96 if(cur_note < 1 || cur_note > 7) continue - for(var/i=2 to lentext(note)) + for(var/i=2 to length(note)) var/ni = copytext(note,i,i+1) if(!text2num(ni)) if(ni == "#" || ni == "b" || ni == "n") @@ -159,11 +159,11 @@ if(!in_range(instrumentObj, usr)) return - if(lentext(t) >= 12000) + if(length(t) >= 12000) var/cont = input(usr, "Your message is too long! Would you like to continue editing it?", "", "yes") in list("yes", "no") if(cont == "no") break - while(lentext(t) > 12000) + while(length(t) > 12000) //split into lines spawn() @@ -180,7 +180,7 @@ lines.Cut(201) var/linenum = 1 for(var/l in lines) - if(lentext(l) > 200) + if(length(l) > 200) to_chat(usr, "Line [linenum] too long!") lines.Remove(l) else @@ -223,7 +223,7 @@ return if(lines.len > 200) return - if(lentext(newline) > 200) + if(length(newline) > 200) newline = copytext(newline, 1, 200) lines.Insert(num, newline) @@ -241,7 +241,7 @@ var/content = html_encode(input("Enter your line: ", instrumentObj.name, lines[num]) as text|null) if(!content || !in_range(instrumentObj, usr)) return - if(lentext(content) > 200) + if(length(content) > 200) content = copytext(content, 1, 200) if(num > lines.len || num < 1) return diff --git a/code/modules/admin/DB ban/functions.dm b/code/modules/admin/DB ban/functions.dm index 1ce6c2b90f0..86a6b228b60 100644 --- a/code/modules/admin/DB ban/functions.dm +++ b/code/modules/admin/DB ban/functions.dm @@ -469,13 +469,13 @@ datum/admins/proc/DB_ban_unban_by_id(var/id) if(playercid) cidsearch = "AND computerid = '[playercid]' " else - if(adminckey && lentext(adminckey) >= 3) + if(adminckey && length(adminckey) >= 3) adminsearch = "AND a_ckey LIKE '[adminckey]%' " - if(playerckey && lentext(playerckey) >= 3) + if(playerckey && length(playerckey) >= 3) playersearch = "AND ckey LIKE '[playerckey]%' " - if(playerip && lentext(playerip) >= 3) + if(playerip && length(playerip) >= 3) ipsearch = "AND ip LIKE '[playerip]%' " - if(playercid && lentext(playercid) >= 7) + if(playercid && length(playercid) >= 7) cidsearch = "AND computerid LIKE '[playercid]%' " if(dbbantype) diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index a318c316532..4c1e86d0fd9 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -3066,7 +3066,7 @@ else if(href_list["ac_set_channel_name"]) src.admincaster_feed_channel.channel_name = strip_html_simple(input(usr, "Provide a Feed Channel Name", "Network Channel Handler", "")) while(findtext(src.admincaster_feed_channel.channel_name," ") == 1) - src.admincaster_feed_channel.channel_name = copytext(src.admincaster_feed_channel.channel_name,2,lentext(src.admincaster_feed_channel.channel_name)+1) + src.admincaster_feed_channel.channel_name = copytext(src.admincaster_feed_channel.channel_name,2,length(src.admincaster_feed_channel.channel_name)+1) src.access_news_network() else if(href_list["ac_set_channel_lock"]) @@ -3105,7 +3105,7 @@ else if(href_list["ac_set_new_message"]) src.admincaster_feed_message.body = adminscrub(input(usr, "Write your Feed story", "Network Channel Handler", "")) while(findtext(src.admincaster_feed_message.body," ") == 1) - src.admincaster_feed_message.body = copytext(src.admincaster_feed_message.body,2,lentext(src.admincaster_feed_message.body)+1) + src.admincaster_feed_message.body = copytext(src.admincaster_feed_message.body,2,length(src.admincaster_feed_message.body)+1) src.access_news_network() else if(href_list["ac_submit_new_message"]) @@ -3159,13 +3159,13 @@ else if(href_list["ac_set_wanted_name"]) src.admincaster_feed_message.author = adminscrub(input(usr, "Provide the name of the Wanted person", "Network Security Handler", "")) while(findtext(src.admincaster_feed_message.author," ") == 1) - src.admincaster_feed_message.author = copytext(admincaster_feed_message.author,2,lentext(admincaster_feed_message.author)+1) + src.admincaster_feed_message.author = copytext(admincaster_feed_message.author,2,length(admincaster_feed_message.author)+1) src.access_news_network() else if(href_list["ac_set_wanted_desc"]) src.admincaster_feed_message.body = adminscrub(input(usr, "Provide the a description of the Wanted person and any other details you deem important", "Network Security Handler", "")) while(findtext(src.admincaster_feed_message.body," ") == 1) - src.admincaster_feed_message.body = copytext(src.admincaster_feed_message.body,2,lentext(src.admincaster_feed_message.body)+1) + src.admincaster_feed_message.body = copytext(src.admincaster_feed_message.body,2,length(src.admincaster_feed_message.body)+1) src.access_news_network() else if(href_list["ac_submit_wanted"]) diff --git a/code/modules/admin/verbs/modifyvariables.dm b/code/modules/admin/verbs/modifyvariables.dm index f3be2161bb2..c5348fbeabe 100644 --- a/code/modules/admin/verbs/modifyvariables.dm +++ b/code/modules/admin/verbs/modifyvariables.dm @@ -306,11 +306,11 @@ var/list/VVpixelmovement = list("step_x", "step_y", "step_size", "bound_height", // the type with the base type removed from the begaining var/fancytype = types[D.type] if(findtext(fancytype, types[type])) - fancytype = copytext(fancytype, lentext(types[type])+1) - var/shorttype = copytext("[D.type]", lentext("[type]")+1) - if(lentext(shorttype) > lentext(fancytype)) + fancytype = copytext(fancytype, length(types[type])+1) + var/shorttype = copytext("[D.type]", length("[type]")+1) + if(length(shorttype) > length(fancytype)) shorttype = fancytype - if(!lentext(shorttype)) + if(!length(shorttype)) shorttype = "/" .["[D]([shorttype])\ref[D]#[i]"] = D diff --git a/code/modules/client/preference/preferences.dm b/code/modules/client/preference/preferences.dm index 11eb454a241..56cb55b6b80 100644 --- a/code/modules/client/preference/preferences.dm +++ b/code/modules/client/preference/preferences.dm @@ -294,8 +294,8 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts dat += "Disabilities: \[Set\]
" dat += "Nanotrasen Relation: [nanotrasen_relation]
" dat += "Set Flavor Text
" - if(lentext(flavor_text) <= 40) - if(!lentext(flavor_text)) dat += "\[...\]
" + if(length(flavor_text) <= 40) + if(!length(flavor_text)) dat += "\[...\]
" else dat += "[flavor_text]
" else dat += "[TextPreview(flavor_text)]...
" @@ -886,21 +886,21 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts HTML += "Medical Records
" - if(lentext(med_record) <= 40) + if(length(med_record) <= 40) HTML += "[med_record]" else HTML += "[copytext(med_record, 1, 37)]..." HTML += "
Employment Records
" - if(lentext(gen_record) <= 40) + if(length(gen_record) <= 40) HTML += "[gen_record]" else HTML += "[copytext(gen_record, 1, 37)]..." HTML += "
Security Records
" - if(lentext(sec_record) <= 40) + if(length(sec_record) <= 40) HTML += "[sec_record]
" else HTML += "[copytext(sec_record, 1, 37)]...
" diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index 84d77d1482e..adb35b0fb3b 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -527,7 +527,7 @@ BLIND // can't see anything end up with a suffix of _open_open if adjusted twice, since their initial state is _open. */ item_state = copytext(item_state, 1, findtext(item_state, "_open")) if(adjust_flavour) - flavour = "[copytext(adjust_flavour, 3, lentext(adjust_flavour) + 1)] up" //Trims off the 'un' at the beginning of the word. unzip -> zip, unbutton->button. + flavour = "[copytext(adjust_flavour, 3, length(adjust_flavour) + 1)] up" //Trims off the 'un' at the beginning of the word. unzip -> zip, unbutton->button. to_chat(user, "You [flavour] \the [src].") suit_adjusted = 0 //Suit is no longer adjusted. for(var/X in actions) diff --git a/code/modules/flufftext/TextFilters.dm b/code/modules/flufftext/TextFilters.dm index 02a02a6f5b2..e00f653ac45 100644 --- a/code/modules/flufftext/TextFilters.dm +++ b/code/modules/flufftext/TextFilters.dm @@ -1,7 +1,7 @@ proc/Intoxicated(phrase) phrase = html_decode(phrase) - var/leng=lentext(phrase) - var/counter=lentext(phrase) + var/leng=length(phrase) + var/counter=length(phrase) var/newphrase="" var/newletter="" while(counter>=1) diff --git a/code/modules/mob/hear_say.dm b/code/modules/mob/hear_say.dm index 45d4cda2202..a91aeed7bdf 100644 --- a/code/modules/mob/hear_say.dm +++ b/code/modules/mob/hear_say.dm @@ -162,7 +162,7 @@ if(copytext(heardword,1, 1) in punctuation) heardword = copytext(heardword,2) if(copytext(heardword,-1) in punctuation) - heardword = copytext(heardword,1,lentext(heardword)) + heardword = copytext(heardword,1,length(heardword)) heard = "...You hear something about... '[heardword]'..." else heard = "...You almost hear something......" diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm index b859041d02f..85bb90a168e 100644 --- a/code/modules/mob/living/carbon/human/examine.dm +++ b/code/modules/mob/living/carbon/human/examine.dm @@ -376,7 +376,7 @@ msg += "*---------*" if(pose) - if( findtext(pose,".",lentext(pose)) == 0 && findtext(pose,"!",lentext(pose)) == 0 && findtext(pose,"?",lentext(pose)) == 0 ) + if( findtext(pose,".",length(pose)) == 0 && findtext(pose,"!",length(pose)) == 0 && findtext(pose,"?",length(pose)) == 0 ) pose = addtext(pose,".") //Makes sure all emotes end with a period. msg += "\n[p_they(TRUE)] [p_are()] [pose]" diff --git a/code/modules/mob/living/silicon/pai/pai.dm b/code/modules/mob/living/silicon/pai/pai.dm index 25547e5de9e..4e280b20de8 100644 --- a/code/modules/mob/living/silicon/pai/pai.dm +++ b/code/modules/mob/living/silicon/pai/pai.dm @@ -538,7 +538,7 @@ if(print_flavor_text()) msg += "\n[print_flavor_text()]" if(pose) - if( findtext(pose,".",lentext(pose)) == 0 && findtext(pose,"!",lentext(pose)) == 0 && findtext(pose,"?",lentext(pose)) == 0 ) + if( findtext(pose,".",length(pose)) == 0 && findtext(pose,"!",length(pose)) == 0 && findtext(pose,"?",length(pose)) == 0 ) pose = addtext(pose,".") //Makes sure all emotes end with a period. msg += "\nIt is [pose]" msg += "\n*---------*" diff --git a/code/modules/mob/living/silicon/robot/examine.dm b/code/modules/mob/living/silicon/robot/examine.dm index 56d01fea839..198b687e496 100644 --- a/code/modules/mob/living/silicon/robot/examine.dm +++ b/code/modules/mob/living/silicon/robot/examine.dm @@ -50,7 +50,7 @@ if(print_flavor_text()) msg += "\n[print_flavor_text()]\n" if(pose) - if( findtext(pose,".",lentext(pose)) == 0 && findtext(pose,"!",lentext(pose)) == 0 && findtext(pose,"?",lentext(pose)) == 0 ) + if( findtext(pose,".",length(pose)) == 0 && findtext(pose,"!",length(pose)) == 0 && findtext(pose,"?",length(pose)) == 0 ) pose = addtext(pose,".") //Makes sure all emotes end with a period. msg += "\nIt is [pose]" diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index c9e77e294d2..609940bc2a6 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -726,7 +726,7 @@ var/list/slot_equipment_priority = list( \ /mob/proc/print_flavor_text(var/shrink = 1) if(flavor_text && flavor_text != "") var/msg = replacetext(flavor_text, "\n", " ") - if(lentext(msg) <= 40 || !shrink) + if(length(msg) <= 40 || !shrink) return "[html_encode(msg)]" //Repeat after me, "I will not give players access to decoded HTML." else return "[copytext_preserve_html(msg, 1, 37)]... More..." diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index 0c2bb902737..a96a832fef4 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -201,8 +201,8 @@ /proc/slur(phrase, var/list/slurletters = ("'"))//use a different list as an input if you want to make robots slur with $#@%! characters phrase = html_decode(phrase) - var/leng=lentext(phrase) - var/counter=lentext(phrase) + var/leng=length(phrase) + var/counter=length(phrase) var/newphrase="" var/newletter="" while(counter>=1) @@ -295,8 +295,8 @@ proc/muffledspeech(phrase) phrase = html_decode(phrase) - var/leng=lentext(phrase) - var/counter=lentext(phrase) + var/leng=length(phrase) + var/counter=length(phrase) var/newphrase="" var/newletter="" while(counter>=1) @@ -571,7 +571,7 @@ var/list/intents = list(INTENT_HELP,INTENT_DISARM,INTENT_GRAB,INTENT_HARM) for(var/datum/objective/objective in GLOB.all_objectives) if(!mind || objective.target != mind) continue - length = lentext(oldname) + length = length(oldname) pos = findtextEx(objective.explanation_text, oldname) objective.explanation_text = copytext(objective.explanation_text, 1, pos)+newname+copytext(objective.explanation_text, pos+length) return 1 @@ -610,8 +610,8 @@ var/list/intents = list(INTENT_HELP,INTENT_DISARM,INTENT_GRAB,INTENT_HARM) /proc/cultslur(n) // Inflicted on victims of a stun talisman var/phrase = html_decode(n) - var/leng = lentext(phrase) - var/counter=lentext(phrase) + var/leng = length(phrase) + var/counter=length(phrase) var/newphrase="" var/newletter="" while(counter>=1) diff --git a/code/modules/shuttle/supply.dm b/code/modules/shuttle/supply.dm index 9da43d08fbf..446b6466dc5 100644 --- a/code/modules/shuttle/supply.dm +++ b/code/modules/shuttle/supply.dm @@ -475,7 +475,7 @@ SSnanoui.update_uis(src) return 1 - var/index = copytext(href_list["doorder"], 1, lentext(href_list["doorder"])) //text2num(copytext(href_list["doorder"], 1)) + var/index = copytext(href_list["doorder"], 1, length(href_list["doorder"])) //text2num(copytext(href_list["doorder"], 1)) var/multi = text2num(copytext(href_list["doorder"], -1)) if(!isnum(multi)) return 1 @@ -656,7 +656,7 @@ SSnanoui.update_uis(src) return 1 - var/index = copytext(href_list["doorder"], 1, lentext(href_list["doorder"])) //text2num(copytext(href_list["doorder"], 1)) + var/index = copytext(href_list["doorder"], 1, length(href_list["doorder"])) //text2num(copytext(href_list["doorder"], 1)) var/multi = text2num(copytext(href_list["doorder"], -1)) if(!isnum(multi)) return 1