Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ jdk: openjdk8

env:
global:
BYOND_MAJOR="512"
BYOND_MINOR="1467"
BYOND_MAJOR="513"
BYOND_MINOR="1507"

# ALL MAPS MUST BE PRESENT HERE
# IF THEY ARE NOT, YOUR BUILD WILL FAIL
Expand Down
16 changes: 8 additions & 8 deletions code/_helpers/text.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// Run all strings to be used in an SQL query through this proc first to properly escape out injection attempts.
/proc/sanitizeSQL(var/t as 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

/*
* Text sanitization
Expand Down Expand Up @@ -292,9 +292,9 @@
//This is used for fingerprints
/proc/stringmerge(var/text,var/compare,replace = "*")
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
Expand All @@ -314,7 +314,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++
Expand All @@ -329,8 +329,8 @@
//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 string
Expand Down Expand Up @@ -555,9 +555,9 @@ proc/TextPreview(var/string,var/len=40)
. += .(rest)

/proc/deep_string_equals(var/A, var/B)
if (lentext(A) != lentext(B))
if (length(A) != length(B))
return FALSE
for (var/i = 1 to lentext(A))
for (var/i = 1 to length(A))
if (text2ascii(A, i) != text2ascii(B, i))
return FALSE
return TRUE
Expand Down
4 changes: 2 additions & 2 deletions code/_helpers/unsorted.dm
Original file line number Diff line number Diff line change
Expand Up @@ -516,11 +516,11 @@ Turf and target are seperate in case you want to teleport some distance from a t
//Makes sure MIDDLE is between LOW and HIGH. If not, it adjusts it. Returns the adjusted value. Lower bound takes priority.
/proc/between(var/low, var/middle, var/high)
return max(min(middle, high), low)

/*
proc/arctan(x)
var/y=arcsin(x/sqrt(1+x*x))
return y

*/
//returns random gauss number
proc/GaussRand(var/sigma)
var/x,y,rsq
Expand Down
2 changes: 1 addition & 1 deletion code/controllers/subsystems/garbage.dm
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ SUBSYSTEM_DEF(garbage)
#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)

/datum/proc/DoSearchVar(X, Xname, recursive_limit = 64)
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/doors/brigdoors.dm
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@
//Stolen from status_display
/obj/machinery/door_timer/proc/texticon(var/tn, var/px = 0, var/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)
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/supply_display.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
message2 = "Error"
else if(shuttle.has_arrive_time())
message2 = get_supply_shuttle_timer()
if(lentext(message2) > CHARS_PER_LINE)
if(length(message2) > CHARS_PER_LINE)
message2 = "Error"
else if (shuttle.is_launching())
if (shuttle.at_station())
Expand Down
14 changes: 7 additions & 7 deletions code/game/objects/items/devices/violin.dm
Original file line number Diff line number Diff line change
Expand Up @@ -214,14 +214,14 @@
if(!playing || !isliving(loc))//If the violin is playing, or isn't held by a person
playing = 0
return
if(lentext(note) == 0)
if(length(note) == 0)
continue
// log_debug("Parse: [copytext(note,1,2)]")

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")
Expand Down Expand Up @@ -326,7 +326,7 @@
return
if(song.lines.len > 50)
return
if(lentext(newline) > 50)
if(length(newline) > 50)
newline = copytext(newline, 1, 50)
song.lines.Add(newline)

Expand All @@ -341,7 +341,7 @@
var/content = html_encode(input("Enter your line: ", "violin", song.lines[num]) as text|null)
if(!content)
return
if(lentext(content) > 50)
if(length(content) > 50)
content = copytext(content, 1, 50)
if(num > song.lines.len || num < 1)
return
Expand All @@ -363,11 +363,11 @@
if(!in_range(src, usr))
return

if(lentext(t) >= 3072)
if(length(t) >= 3072)
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) > 3072)
while(length(t) > 3072)

//split into lines
spawn()
Expand All @@ -381,7 +381,7 @@
lines.Cut(51)
var/linenum = 1
for(var/l in lines)
if(lentext(l) > 50)
if(length(l) > 50)
to_chat(usr, "Line [linenum] too long!")
lines.Remove(l)
else
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/weapons/paint.dm
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ var/global/list/cached_icons = list()

/obj/item/weapon/reagent_containers/glass/paint/Initialize()
. = ..()
if(paint_hex && lentext(paint_hex) > 0)
if(paint_hex && length(paint_hex) > 0)
reagents.add_reagent(/datum/reagent/paint, volume, paint_hex)
update_icon()

Expand Down
14 changes: 7 additions & 7 deletions code/game/objects/structures/musician.dm
Original file line number Diff line number Diff line change
Expand Up @@ -233,14 +233,14 @@
if(!playing || !anchored)//If the piano is playing, or is loose
playing = 0
return
if(lentext(note) == 0)
if(length(note) == 0)
continue
// log_debug("Parse: [copytext(note,1,2)]")

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")
Expand Down Expand Up @@ -347,7 +347,7 @@
return
if(song.lines.len > 100)
return
if(lentext(newline) > 100)
if(length(newline) > 100)
newline = copytext(newline, 1, 100)
song.lines.Add(newline)

Expand All @@ -362,7 +362,7 @@
var/content = html_encode(input("Enter your line: ", "Piano", song.lines[num]) as text|null)
if(!content)
return
if(lentext(content) > 100)
if(length(content) > 100)
content = copytext(content, 1, 100)
if(num > song.lines.len || num < 1)
return
Expand All @@ -384,11 +384,11 @@
if (!in_range(src, usr))
return

if(lentext(t) >= 4072)
if(length(t) >= 4072)
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) > 4072)
while(length(t) > 4072)

//split into lines
spawn()
Expand All @@ -402,7 +402,7 @@
lines.Cut(51)
var/linenum = 1
for(var/l in lines)
if(lentext(l) > 100)
if(length(l) > 100)
to_chat(usr, "Line [linenum] too long!")
lines.Remove(l)
else
Expand Down
8 changes: 4 additions & 4 deletions code/modules/admin/DB ban/functions.dm
Original file line number Diff line number Diff line change
Expand Up @@ -413,13 +413,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)
Expand Down
6 changes: 3 additions & 3 deletions code/modules/emotes/emote_mob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
name_anchor = findtext(message, anchor_char)
if(name_anchor > 0) // User supplied emote with visible_emote token (default ^)
pretext = copytext(message, 1, name_anchor)
subtext = copytext(message, name_anchor + 1, lentext(message) + 1)
subtext = copytext(message, name_anchor + 1, length(message) + 1)
else
// No token. Just the emote as usual.
subtext = message
Expand All @@ -92,12 +92,12 @@

if(pretext)
// Add a space at the end if we didn't already supply one.
end_char = copytext(pretext, lentext(pretext), lentext(pretext) + 1)
end_char = copytext(pretext, length(pretext), length(pretext) + 1)
if(end_char != " ")
pretext += " "

// Grab the last character of the emote message.
end_char = copytext(subtext, lentext(subtext), lentext(subtext) + 1)
end_char = copytext(subtext, length(subtext), length(subtext) + 1)
if(!(end_char in list(".", "?", "!", "\"", "-", "~"))) // gotta include ~ for all you fucking weebs
// No punctuation supplied. Tack a period on the end.
subtext += "."
Expand Down
4 changes: 2 additions & 2 deletions code/modules/flufftext/TextFilters.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

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)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/hear_say.dm
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,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 = "<span class = 'game_say'>...You hear something about...[heardword]</span>"

else
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/carbon/human/examine.dm
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@
msg += applying_pressure

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 += "[T.He] [pose]\n"

Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/say.dm
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ proc/get_radio_key_from_channel(var/channel)

message = html_decode(message)

var/end_char = copytext(message, lentext(message), lentext(message) + 1)
var/end_char = copytext(message, length(message), length(message) + 1)
if(!(end_char in list(".", "?", "!", "-", "~")))
message += "."

Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/silicon/pai/examine.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,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]"

Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/silicon/robot/examine.dm
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,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]"

Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/mob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@
/mob/proc/print_flavor_text()
if (flavor_text && flavor_text != "")
var/msg = replacetext(flavor_text, "\n", " ")
if(lentext(msg) <= 40)
if(length(msg) <= 40)
return "<span class='notice'>[msg]</span>"
else
return "<span class='notice'>[copytext_preserve_html(msg, 1, 37)]... <a href='byond://?src=\ref[src];flavor_more=1'>More...</a></span>"
Expand Down
4 changes: 2 additions & 2 deletions code/modules/mob/mob_helpers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,8 @@ var/list/global/organ_rel_size = list(

proc/slur(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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ LEGACY_RECORD_STRUCTURE(all_warrants, warrant)
var/list/archivedwarrants = list()
for(var/datum/computer_file/data/warrant/W in GLOB.all_warrants)
var/charges = W.fields["charges"]
if(lentext(charges) > 50)
if(length(charges) > 50)
charges = copytext(charges, 1, 50) + "..."
var/warrant = list(
"warrantname" = W.fields["namewarrant"],
Expand Down
4 changes: 2 additions & 2 deletions code/modules/organs/blood.dm
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,8 @@
if(blood_species != species.name)
return 1

var/donor_antigen = copytext(blood_type, 1, lentext(blood_type))
var/receiver_antigen = copytext(dna.b_type, 1, lentext(dna.b_type))
var/donor_antigen = copytext(blood_type, 1, length(blood_type))
var/receiver_antigen = copytext(dna.b_type, 1, length(dna.b_type))
var/donor_rh = (findtext(blood_type, "+") > 0)
var/receiver_rh = (findtext(dna.b_type, "+") > 0)

Expand Down
2 changes: 1 addition & 1 deletion code/modules/organs/external/_external.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1038,7 +1038,7 @@ Note that amputating the affected organ does in fact remove the infection from t
W.germ_level = 0
return rval

/obj/item/organ/external/proc/clamp()
/obj/item/organ/external/proc/clampOrgan()
var/rval = 0
src.status &= ~ORGAN_BLEEDING
for(var/datum/wound/W in wounds)
Expand Down
Loading