mirror of
https://github.com/goonstation/goonstation-2016.git
synced 2026-07-19 21:12:41 +01:00
repace lentext with length procs
This commit is contained in:
@@ -277,7 +277,7 @@ proc/Create_Tommyname()
|
||||
var/hash = md5("AReally[id]ShittySalt")
|
||||
var/listPos = calc_start_point(hash)
|
||||
|
||||
for(var/i=1, i <= lentext(hash), i+=2)
|
||||
for(var/i=1, i <= length(hash), i+=2)
|
||||
var/block = copytext(hash, i, i+2)
|
||||
if (isnull(base["[listPos]"]))
|
||||
base["[listPos]"] = hex2num(block)
|
||||
@@ -288,7 +288,7 @@ proc/Create_Tommyname()
|
||||
|
||||
//So is this
|
||||
proc/calc_start_point(var/hash)
|
||||
for(var/i = 1; i <= lentext(hash); i++)
|
||||
for(var/i = 1; i <= length(hash); i++)
|
||||
var/temp = copytext(hash, i, i+1)
|
||||
temp = hex2num(temp)
|
||||
. += temp
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
ldata[index] = base64str(ldata[index])
|
||||
return ldata
|
||||
|
||||
var/field = copytext(index, lentext(num)+1, 0) //grab the field name e.g. [ckey]
|
||||
var/field = copytext(index, length(num)+1, 0) //grab the field name e.g. [ckey]
|
||||
field = copytext(field, 2, -1) //convert [ckey] to ckey
|
||||
var/val = base64str(ldata[index]) //the actual value e.g. blah
|
||||
|
||||
|
||||
@@ -1511,7 +1511,7 @@ proc/num2hexoc(num, pad)
|
||||
|
||||
// One's complement reverse engineering of a hexadecimal one's complement representation to a base 10 signed number
|
||||
proc/hex2numoc(var/num)
|
||||
var/len = lentext(num)
|
||||
var/len = length(num)
|
||||
var/max = 7
|
||||
for (var/i = len - 1, i > 0, i--)
|
||||
max = max * 16 + 15
|
||||
|
||||
@@ -145,7 +145,7 @@ datum/pathogendna
|
||||
proc/explode()
|
||||
var/list/ret = new/list()
|
||||
var/pos = 1
|
||||
while (pos < lentext(seqsplice))
|
||||
while (pos < length(seqsplice))
|
||||
if (copytext(seqsplice, pos, pos + 1) != "|")
|
||||
ret += copytext(seqsplice, pos, pos + 3)
|
||||
pos += 3
|
||||
|
||||
@@ -475,8 +475,8 @@
|
||||
if(src.manip.splicesource && src.manip.slots[src.manip.splicesource])
|
||||
var/datum/pathogendna/P = src.manip.slots[src.manip.splicesource]
|
||||
sOut = P.seqsplice
|
||||
tOut = lentext(tOut) > 0 ? "\"[tOut]\"" : "null"
|
||||
sOut = lentext(sOut) > 0 ? "\"[sOut]\"" : "null"
|
||||
tOut = length(tOut) > 0 ? "\"[tOut]\"" : "null"
|
||||
sOut = length(sOut) > 0 ? "\"[sOut]\"" : "null"
|
||||
|
||||
gui.sendToSubscribers({"{"splice":{"source":[sOut],"target":[tOut],"pred":[predictive_data],"selSource":[src.manip.sel_source],"selTarget":[src.manip.sel_target],"selected":[src.manip.splicesource]}}"}, "setUIState")
|
||||
|
||||
@@ -558,7 +558,7 @@
|
||||
sendAnalysisData()
|
||||
|
||||
if (href_list["analysisappend"])
|
||||
if (lentext(src.manip.analysis) >= 15)
|
||||
if (length(src.manip.analysis) >= 15)
|
||||
return
|
||||
|
||||
var/id = text2num(href_list["analysisappend"])
|
||||
@@ -576,7 +576,7 @@
|
||||
if (href_list["analysisdo"])
|
||||
if (!src.manip.analysis)
|
||||
return
|
||||
var/tlen = lentext(src.manip.analysis)
|
||||
var/tlen = length(src.manip.analysis)
|
||||
if (tlen < 3)
|
||||
return
|
||||
var/analyzed = src.manip.analysis
|
||||
@@ -602,11 +602,11 @@
|
||||
for (var/i = 1, i <= bits, i++)
|
||||
var/curr = copytext(analyzed, (i - 1) * 3 + 1, i * 3 + 1)
|
||||
acc += curr
|
||||
var/acc_len = lentext(acc)
|
||||
var/acc_len = length(acc)
|
||||
var/total = 0
|
||||
var/match = 0
|
||||
for (var/dna in pathogen_controller.UID_to_symptom)
|
||||
var/dnalen = lentext(dna)
|
||||
var/dnalen = length(dna)
|
||||
if (dnalen >= acc_len)
|
||||
total++
|
||||
if (dnalen == acc_len)
|
||||
|
||||
@@ -282,7 +282,7 @@ var/reverse_mode = 0
|
||||
|
||||
/proc/reverse_text(var/string)
|
||||
var/new_string=""
|
||||
for(var/i=lentext(string)+1, i>0, i--)
|
||||
for(var/i=length(string)+1, i>0, i--)
|
||||
new_string += copytext(string,i,i+1)
|
||||
return new_string
|
||||
|
||||
|
||||
Reference in New Issue
Block a user