diff --git a/code/__DEFINES/typeids.dm b/code/__DEFINES/typeids.dm index ae5df258b4..8bfe6216e2 100644 --- a/code/__DEFINES/typeids.dm +++ b/code/__DEFINES/typeids.dm @@ -2,7 +2,7 @@ #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) diff --git a/code/__HELPERS/text.dm b/code/__HELPERS/text.dm index 6908a5057f..8494bbb7a9 100644 --- a/code/__HELPERS/text.dm +++ b/code/__HELPERS/text.dm @@ -304,9 +304,9 @@ //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 @@ -326,7 +326,7 @@ 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++ @@ -607,8 +607,8 @@ GLOBAL_LIST_INIT(binary, list("0","1")) continue var/buffer = "" var/early_culling = TRUE - for(var/pos = 1, pos <= lentext(string), pos++) - var/let = copytext(string, pos, (pos + 1) % lentext(string)) + for(var/pos = 1, pos <= length(string), pos++) + var/let = copytext(string, pos, (pos + 1) % length(string)) if(early_culling && !findtext(let,GLOB.is_alphanumeric)) continue early_culling = FALSE @@ -616,9 +616,9 @@ GLOBAL_LIST_INIT(binary, list("0","1")) if(!findtext(buffer,GLOB.is_alphanumeric)) continue var/punctbuffer = "" - var/cutoff = lentext(buffer) - for(var/pos = lentext(buffer), pos >= 0, pos--) - var/let = copytext(buffer, pos, (pos + 1) % lentext(buffer)) + var/cutoff = length(buffer) + for(var/pos = length(buffer), pos >= 0, pos--) + var/let = copytext(buffer, pos, (pos + 1) % length(buffer)) if(findtext(let,GLOB.is_alphanumeric)) break if(findtext(let,GLOB.is_punctuation)) @@ -628,8 +628,8 @@ GLOBAL_LIST_INIT(binary, list("0","1")) var/exclaim = FALSE var/question = FALSE var/periods = 0 - for(var/pos = lentext(punctbuffer), pos >= 0, pos--) - var/punct = copytext(punctbuffer, pos, (pos + 1) % lentext(punctbuffer)) + for(var/pos = length(punctbuffer), pos >= 0, pos--) + var/punct = copytext(punctbuffer, pos, (pos + 1) % length(punctbuffer)) if(!exclaim && findtext(punct,"!")) exclaim = TRUE if(!question && findtext(punct,"?")) @@ -651,7 +651,7 @@ GLOBAL_LIST_INIT(binary, list("0","1")) buffer = copytext(buffer, 1, cutoff) + punctbuffer if(!findtext(buffer,GLOB.is_alphanumeric)) continue - if(!buffer || lentext(buffer) > 280 || lentext(buffer) <= cullshort || buffer in accepted) + if(!buffer || length(buffer) > 280 || length(buffer) <= cullshort || buffer in accepted) continue accepted += buffer diff --git a/code/__HELPERS/text_vr.dm b/code/__HELPERS/text_vr.dm index 64e13ef65b..9be806fc54 100644 --- a/code/__HELPERS/text_vr.dm +++ b/code/__HELPERS/text_vr.dm @@ -9,8 +9,8 @@ return t proc/TextPreview(var/string,var/len=40) - if(lentext(string) <= len) - if(!lentext(string)) + if(length(string) <= len) + if(!length(string)) return "\[...\]" else return string diff --git a/code/datums/mutations.dm b/code/datums/mutations.dm index efa248b4f0..f689ff903e 100644 --- a/code/datums/mutations.dm +++ b/code/datums/mutations.dm @@ -30,7 +30,7 @@ GLOBAL_LIST_EMPTY(mutations_list) . = on_losing(owner) /datum/mutation/human/proc/set_se(se_string, on = 1) - if(!se_string || lentext(se_string) < DNA_STRUC_ENZYMES_BLOCKS * DNA_BLOCK_SIZE) + if(!se_string || length(se_string) < DNA_STRUC_ENZYMES_BLOCKS * DNA_BLOCK_SIZE) return var/before = copytext(se_string, 1, ((dna_block - 1) * DNA_BLOCK_SIZE) + 1) var/injection = num2hex(on ? rand(lowest_value, (256 * 16) - 1) : rand(0, lowest_value - 1), DNA_BLOCK_SIZE) @@ -42,7 +42,7 @@ GLOBAL_LIST_EMPTY(mutations_list) owner.dna.struc_enzymes = set_se(owner.dna.struc_enzymes, on) /datum/mutation/human/proc/check_block_string(se_string) - if(!se_string || lentext(se_string) < DNA_STRUC_ENZYMES_BLOCKS * DNA_BLOCK_SIZE) + if(!se_string || length(se_string) < DNA_STRUC_ENZYMES_BLOCKS * DNA_BLOCK_SIZE) return 0 if(hex2num(getblock(se_string, dna_block)) >= lowest_value) return 1 diff --git a/code/game/machinery/newscaster.dm b/code/game/machinery/newscaster.dm index c37c607a6e..6bf9930eec 100644 --- a/code/game/machinery/newscaster.dm +++ b/code/game/machinery/newscaster.dm @@ -515,7 +515,7 @@ GLOBAL_LIST_EMPTY(allCasters) if(href_list["set_channel_name"]) channel_name = stripped_input(usr, "Provide a Feed Channel Name", "Network Channel Handler", "", MAX_NAME_LEN) while (findtext(channel_name," ") == 1) - channel_name = copytext(channel_name,2,lentext(channel_name)+1) + channel_name = copytext(channel_name,2,length(channel_name)+1) updateUsrDialog() else if(href_list["set_channel_lock"]) c_locked = !c_locked diff --git a/code/game/machinery/status_display.dm b/code/game/machinery/status_display.dm index e9216ca736..ec53cc3210 100644 --- a/code/game/machinery/status_display.dm +++ b/code/game/machinery/status_display.dm @@ -243,7 +243,7 @@ else line1 = "CARGO" line2 = SSshuttle.supply.getTimerStr() - if(lentext(line2) > CHARS_PER_LINE) + if(length(line2) > CHARS_PER_LINE) line2 = "Error" update_display(line1, line2) diff --git a/code/game/objects/structures/musician.dm b/code/game/objects/structures/musician.dm index 0e2f951f38..36dbcc1e28 100644 --- a/code/game/objects/structures/musician.dm +++ b/code/game/objects/structures/musician.dm @@ -104,12 +104,12 @@ playing = FALSE hearing_mobs = null return - if(!lentext(note)) + if(!length(note)) 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") @@ -209,7 +209,7 @@ lines.Cut(MUSIC_MAXLINES + 1) var/linenum = 1 for(var/l in lines) - if(lentext(l) > MUSIC_MAXLINECHARS) + if(length(l) > MUSIC_MAXLINECHARS) to_chat(usr, "Line [linenum] too long!") lines.Remove(l) else @@ -236,11 +236,11 @@ if(!in_range(instrumentObj, usr)) return - if(lentext(t) >= MUSIC_MAXLINES * MUSIC_MAXLINECHARS) + if(length(t) >= MUSIC_MAXLINES * MUSIC_MAXLINECHARS) 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) > MUSIC_MAXLINES * MUSIC_MAXLINECHARS) + while(length(t) > MUSIC_MAXLINES * MUSIC_MAXLINECHARS) ParseSong(t) else if(href_list["help"]) @@ -272,7 +272,7 @@ return if(lines.len > MUSIC_MAXLINES) return - if(lentext(newline) > MUSIC_MAXLINECHARS) + if(length(newline) > MUSIC_MAXLINECHARS) newline = copytext(newline, 1, MUSIC_MAXLINECHARS) lines.Add(newline) @@ -287,7 +287,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) > MUSIC_MAXLINECHARS) + if(length(content) > MUSIC_MAXLINECHARS) content = copytext(content, 1, MUSIC_MAXLINECHARS) if(num > lines.len || num < 1) return diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index b0b9190556..8b105da43b 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -1347,7 +1347,7 @@ else if(href_list["f_secret"]) return HandleFSecret() - + else if(href_list["f_dynamic_roundstart"]) if(!check_rights(R_ADMIN)) return @@ -1593,7 +1593,7 @@ GLOB.dynamic_stacking_limit = input(usr,"Change the threat limit at which round-endings rulesets will start to stack.", "Change stacking limit", null) as num log_admin("[key_name(usr)] set 'stacking_limit' to [GLOB.dynamic_stacking_limit].") message_admins("[key_name(usr)] set 'stacking_limit' to [GLOB.dynamic_stacking_limit].") - dynamic_mode_options(usr) + dynamic_mode_options(usr) else if(href_list["f_dynamic_high_pop_limit"]) if(!check_rights(R_ADMIN)) @@ -1612,7 +1612,7 @@ log_admin("[key_name(usr)] set 'high_pop_limit' to [GLOB.dynamic_high_pop_limit].") message_admins("[key_name(usr)] set 'high_pop_limit' to [GLOB.dynamic_high_pop_limit].") - dynamic_mode_options(usr) + dynamic_mode_options(usr) else if(href_list["f_dynamic_forced_threat"]) if(!check_rights(R_ADMIN)) @@ -1631,7 +1631,7 @@ log_admin("[key_name(usr)] set 'forced_threat_level' to [GLOB.dynamic_forced_threat_level].") message_admins("[key_name(usr)] set 'forced_threat_level' to [GLOB.dynamic_forced_threat_level].") - dynamic_mode_options(usr) + dynamic_mode_options(usr) else if(href_list["c_mode2"]) if(!check_rights(R_ADMIN|R_SERVER)) @@ -2442,7 +2442,7 @@ return src.admincaster_feed_channel.channel_name = stripped_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"]) @@ -2484,7 +2484,7 @@ return src.admincaster_feed_message.body = adminscrub(input(usr, "Write your Feed story.", "Network Channel Handler", "")) while (findtext(src.admincaster_feed_message.returnBody(-1)," ") == 1) - src.admincaster_feed_message.body = copytext(src.admincaster_feed_message.returnBody(-1),2,lentext(src.admincaster_feed_message.returnBody(-1))+1) + src.admincaster_feed_message.body = copytext(src.admincaster_feed_message.returnBody(-1),2,length(src.admincaster_feed_message.returnBody(-1))+1) src.access_news_network() else if(href_list["ac_submit_new_message"]) @@ -2545,7 +2545,7 @@ return src.admincaster_wanted_message.criminal = adminscrub(input(usr, "Provide the name of the Wanted person.", "Network Security Handler", "")) while(findtext(src.admincaster_wanted_message.criminal," ") == 1) - src.admincaster_wanted_message.criminal = copytext(admincaster_wanted_message.criminal,2,lentext(admincaster_wanted_message.criminal)+1) + src.admincaster_wanted_message.criminal = copytext(admincaster_wanted_message.criminal,2,length(admincaster_wanted_message.criminal)+1) src.access_news_network() else if(href_list["ac_set_wanted_desc"]) @@ -2553,7 +2553,7 @@ return src.admincaster_wanted_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_wanted_message.body," ") == 1) - src.admincaster_wanted_message.body = copytext(src.admincaster_wanted_message.body,2,lentext(src.admincaster_wanted_message.body)+1) + src.admincaster_wanted_message.body = copytext(src.admincaster_wanted_message.body,2,length(src.admincaster_wanted_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 e70ea1c1b3..644b2729e0 100644 --- a/code/modules/admin/verbs/modifyvariables.dm +++ b/code/modules/admin/verbs/modifyvariables.dm @@ -307,11 +307,11 @@ GLOBAL_PROTECT(VVpixelmovement) // 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/preferences.dm b/code/modules/client/preferences.dm index edec4d74a6..b3b6f0b576 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -336,8 +336,8 @@ GLOBAL_LIST_EMPTY(preferences_datums) dat += "
"
dat += "Flavor Text" dat += "Set Examine Text" - if(lentext(features["flavor_text"]) <= 40) - if(!lentext(features["flavor_text"])) + if(length(features["flavor_text"]) <= 40) + if(!length(features["flavor_text"])) dat += "\[...\]" else dat += "[features["flavor_text"]]" diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index d599d55886..d896323cdb 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -231,7 +231,7 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER) var/r_val var/b_val var/g_val - var/color_format = lentext(input_color) + var/color_format = length(input_color) if(color_format == 3) r_val = hex2num(copytext(input_color, 1, 2))*16 g_val = hex2num(copytext(input_color, 2, 3))*16 diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index a44779e05e..2ab7c6d404 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -778,7 +778,7 @@ broken_plural = TRUE else var/holder = broken[1] //our one and only element - if(holder[lentext(holder)] == "s") + if(holder[length(holder)] == "s") broken_plural = TRUE //Put the items in that list into a string of text for(var/B in broken) @@ -790,7 +790,7 @@ damaged_plural = TRUE else var/holder = damaged[1] - if(holder[lentext(holder)] == "s") + if(holder[length(holder)] == "s") damaged_plural = TRUE for(var/D in damaged) damaged_message += D diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index eb22ab7403..9674c73a88 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -67,8 +67,8 @@ /proc/slur(n,var/strength=50) strength = min(strength,50) 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) @@ -102,8 +102,8 @@ /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/mob/say_vr.dm b/code/modules/mob/say_vr.dm index 1fc97c31e4..4bbeef707a 100644 --- a/code/modules/mob/say_vr.dm +++ b/code/modules/mob/say_vr.dm @@ -25,7 +25,7 @@ if(flavor_text && flavor_text != "") // We are decoding and then encoding to not only get correct amount of characters, but also to prevent partial escaping characters being shown. var/msg = html_decode(replacetext(flavor_text, "\n", " ")) - if(lentext(msg) <= 40) + if(length(msg) <= 40) return "[html_encode(msg)]" else return "[html_encode(copytext(msg, 1, 37))]... More..." diff --git a/tools/Redirector/textprocs.dm b/tools/Redirector/textprocs.dm index 1b91511332..aedafe39da 100644 --- a/tools/Redirector/textprocs.dm +++ b/tools/Redirector/textprocs.dm @@ -40,12 +40,12 @@ proc ///////////////////// dd_hasprefix(text, prefix) var/start = 1 - var/end = lentext(prefix) + 1 + var/end = length(prefix) + 1 return findtext(text, prefix, start, end) dd_hasPrefix(text, prefix) var/start = 1 - var/end = lentext(prefix) + 1 + var/end = length(prefix) + 1 return findtextEx(text, prefix, start, end) @@ -66,8 +66,8 @@ proc // Turning text into lists // ///////////////////////////// dd_text2list(text, separator) - var/textlength = lentext(text) - var/separatorlength = lentext(separator) + var/textlength = length(text) + var/separatorlength = length(separator) var/list/textList = new /list() var/searchPosition = 1 var/findPosition = 1 @@ -86,8 +86,8 @@ proc return textList dd_text2List(text, separator) - var/textlength = lentext(text) - var/separatorlength = lentext(separator) + var/textlength = length(text) + var/separatorlength = length(separator) var/list/textList = new /list() var/searchPosition = 1 var/findPosition = 1 |