mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 02:09:41 +00:00
Removes unnecessary, unused, and redundant helpers.
This commit is contained in:
@@ -1,209 +0,0 @@
|
||||
#if DM_VERSION < 510
|
||||
|
||||
json_token
|
||||
var
|
||||
value
|
||||
New(v)
|
||||
src.value = v
|
||||
text
|
||||
number
|
||||
word
|
||||
symbol
|
||||
eof
|
||||
|
||||
json_reader
|
||||
var
|
||||
list
|
||||
string = list("'", "\"")
|
||||
symbols = list("{", "}", "\[", "]", ":", "\"", "'", ",")
|
||||
sequences = list("b" = 8, "t" = 9, "n" = 10, "f" = 12, "r" = 13)
|
||||
tokens
|
||||
json
|
||||
i = 1
|
||||
|
||||
|
||||
proc
|
||||
// scanner
|
||||
ScanJson(json)
|
||||
src.json = json
|
||||
. = new/list()
|
||||
src.i = 1
|
||||
while(src.i <= length(json))
|
||||
var/char = get_char()
|
||||
if(is_whitespace(char))
|
||||
i++
|
||||
continue
|
||||
if(string.Find(char))
|
||||
. += read_string(char)
|
||||
else if(symbols.Find(char))
|
||||
. += new/json_token/symbol(char)
|
||||
else if(is_digit(char))
|
||||
. += read_number()
|
||||
else
|
||||
. += read_word()
|
||||
i++
|
||||
. += new/json_token/eof()
|
||||
|
||||
read_word()
|
||||
var/val = ""
|
||||
while(i <= length(json))
|
||||
var/char = get_char()
|
||||
if(is_whitespace(char) || symbols.Find(char))
|
||||
i-- // let scanner handle this character
|
||||
return new/json_token/word(val)
|
||||
val += char
|
||||
i++
|
||||
|
||||
read_string(delim)
|
||||
var
|
||||
escape = FALSE
|
||||
val = ""
|
||||
while(++i <= length(json))
|
||||
var/char = get_char()
|
||||
if(escape)
|
||||
switch(char)
|
||||
if("\\", "'", "\"", "/", "u")
|
||||
val += char
|
||||
else
|
||||
// TODO: support octal, hex, unicode sequences
|
||||
ASSERT(sequences.Find(char))
|
||||
val += ascii2text(sequences[char])
|
||||
else
|
||||
if(char == delim)
|
||||
return new/json_token/text(val)
|
||||
else if(char == "\\")
|
||||
escape = TRUE
|
||||
else
|
||||
val += char
|
||||
CRASH("Unterminated string.")
|
||||
|
||||
read_number()
|
||||
var/val = ""
|
||||
var/char = get_char()
|
||||
while(is_digit(char) || char == "." || lowertext(char) == "e")
|
||||
val += char
|
||||
i++
|
||||
char = get_char()
|
||||
i-- // allow scanner to read the first non-number character
|
||||
return new/json_token/number(text2num(val))
|
||||
|
||||
check_char()
|
||||
ASSERT(args.Find(get_char()))
|
||||
|
||||
get_char()
|
||||
return copytext(json, i, i+1)
|
||||
|
||||
is_whitespace(char)
|
||||
return char == " " || char == "\t" || char == "\n" || text2ascii(char) == 13
|
||||
|
||||
is_digit(char)
|
||||
var/c = text2ascii(char)
|
||||
return 48 <= c && c <= 57 || char == "+" || char == "-"
|
||||
|
||||
|
||||
// parser
|
||||
ReadObject(list/tokens)
|
||||
src.tokens = tokens
|
||||
. = new/list()
|
||||
i = 1
|
||||
read_token("{", /json_token/symbol)
|
||||
while(i <= tokens.len)
|
||||
var/json_token/K = get_token()
|
||||
check_type(/json_token/word, /json_token/text)
|
||||
next_token()
|
||||
read_token(":", /json_token/symbol)
|
||||
|
||||
.[K.value] = read_value()
|
||||
|
||||
var/json_token/S = get_token()
|
||||
check_type(/json_token/symbol)
|
||||
switch(S.value)
|
||||
if(",")
|
||||
next_token()
|
||||
continue
|
||||
if("}")
|
||||
next_token()
|
||||
return
|
||||
else
|
||||
die()
|
||||
|
||||
get_token()
|
||||
return tokens[i]
|
||||
|
||||
next_token()
|
||||
return tokens[++i]
|
||||
|
||||
read_token(val, type)
|
||||
var/json_token/T = get_token()
|
||||
if(!(T.value == val && istype(T, type)))
|
||||
CRASH("Expected '[val]', found '[T.value]'.")
|
||||
next_token()
|
||||
return T
|
||||
|
||||
check_type(...)
|
||||
var/json_token/T = get_token()
|
||||
for(var/type in args)
|
||||
if(istype(T, type))
|
||||
return
|
||||
CRASH("Bad token type: [T.type].")
|
||||
|
||||
check_value(...)
|
||||
var/json_token/T = get_token()
|
||||
ASSERT(args.Find(T.value))
|
||||
|
||||
read_key()
|
||||
var/char = get_char()
|
||||
if(char == "\"" || char == "'")
|
||||
return read_string(char)
|
||||
|
||||
read_value()
|
||||
var/json_token/T = get_token()
|
||||
switch(T.type)
|
||||
if(/json_token/text, /json_token/number)
|
||||
next_token()
|
||||
return T.value
|
||||
if(/json_token/word)
|
||||
next_token()
|
||||
switch(T.value)
|
||||
if("true")
|
||||
return TRUE
|
||||
if("false")
|
||||
return FALSE
|
||||
if("null")
|
||||
return null
|
||||
if(/json_token/symbol)
|
||||
switch(T.value)
|
||||
if("\[")
|
||||
return read_array()
|
||||
if("{")
|
||||
return ReadObject(tokens.Copy(i))
|
||||
die()
|
||||
|
||||
read_array()
|
||||
read_token("\[", /json_token/symbol)
|
||||
. = new/list()
|
||||
var/list/L = .
|
||||
while(i <= tokens.len)
|
||||
// Avoid using Add() or += in case a list is returned.
|
||||
L.len++
|
||||
L[L.len] = read_value()
|
||||
var/json_token/T = get_token()
|
||||
check_type(/json_token/symbol)
|
||||
switch(T.value)
|
||||
if(",")
|
||||
next_token()
|
||||
continue
|
||||
if("]")
|
||||
next_token()
|
||||
return
|
||||
else
|
||||
die()
|
||||
next_token()
|
||||
CRASH("Unterminated array.")
|
||||
|
||||
|
||||
die(json_token/T)
|
||||
if(!T) T = get_token()
|
||||
CRASH("Unexpected token: [T.value].")
|
||||
|
||||
#endif
|
||||
@@ -1,62 +0,0 @@
|
||||
#if DM_VERSION < 510
|
||||
|
||||
json_writer
|
||||
var
|
||||
use_cache = 0
|
||||
|
||||
proc
|
||||
WriteObject(list/L)
|
||||
if(use_cache && L["__json_cache"])
|
||||
return L["__json_cache"]
|
||||
|
||||
. = "{"
|
||||
var/i = 1
|
||||
for(var/k in L)
|
||||
var/val = L[k]
|
||||
. += {"\"[k]\":[write(val)]"}
|
||||
if(i++ < L.len)
|
||||
. += ","
|
||||
. += "}"
|
||||
|
||||
write(val)
|
||||
if(isnum(val))
|
||||
return num2text(val)
|
||||
else if(isnull(val))
|
||||
return "null"
|
||||
else if(istype(val, /list))
|
||||
if(is_associative(val))
|
||||
return WriteObject(val)
|
||||
else
|
||||
return write_array(val)
|
||||
else
|
||||
. += write_string("[val]")
|
||||
|
||||
write_array(list/L)
|
||||
. = "\["
|
||||
for(var/i = 1 to L.len)
|
||||
. += write(L[i])
|
||||
if(i < L.len)
|
||||
. += ","
|
||||
. += "]"
|
||||
|
||||
write_string(txt)
|
||||
var/static/list/json_escape = list("\\" = "\\\\", "\"" = "\\\"", "\n" = "\\n")
|
||||
for(var/targ in json_escape)
|
||||
var/start = 1
|
||||
while(start <= length(txt))
|
||||
var/i = findtext(txt, targ, start)
|
||||
if(!i)
|
||||
break
|
||||
var/lrep = length(json_escape[targ])
|
||||
txt = copytext(txt, 1, i) + json_escape[targ] + copytext(txt, i + length(targ))
|
||||
start = i + lrep
|
||||
|
||||
return {""[txt]""}
|
||||
|
||||
is_associative(list/L)
|
||||
for(var/key in L)
|
||||
// if the key is a list that means it's actually an array of lists (stupid Byond...)
|
||||
if(!isnum(key) && !isnull(L[key]) && !istype(key, /list))
|
||||
return TRUE
|
||||
|
||||
#endif
|
||||
@@ -1,14 +0,0 @@
|
||||
#if DM_VERSION < 510
|
||||
/*
|
||||
n_Json v11.3.21
|
||||
*/
|
||||
|
||||
proc
|
||||
json_decode(json)
|
||||
var/static/json_reader/_jsonr = new()
|
||||
return _jsonr.ReadObject(_jsonr.ScanJson(json))
|
||||
|
||||
json_encode(list/L)
|
||||
var/static/json_writer/_jsonw = new()
|
||||
return _jsonw.write(L)
|
||||
#endif
|
||||
@@ -1,6 +0,0 @@
|
||||
#if DM_VERSION < 510
|
||||
|
||||
/proc/replacetext(text, find, replacement)
|
||||
return jointext(splittext(text, find), replacement)
|
||||
|
||||
#endif
|
||||
@@ -1,102 +0,0 @@
|
||||
#if DM_VERSION < 510
|
||||
// Concatenates a list of strings into a single string. A seperator may optionally be provided.
|
||||
/proc/jointext(list/ls, sep)
|
||||
if (ls.len <= 1) // Early-out code for empty or singleton lists.
|
||||
return ls.len ? ls[1] : ""
|
||||
|
||||
var/l = ls.len // Made local for sanic speed.
|
||||
var/i = 0 // Incremented every time a list index is accessed.
|
||||
|
||||
if (sep <> null)
|
||||
// Macros expand to long argument lists like so: sep, ls[++i], sep, ls[++i], sep, ls[++i], etc...
|
||||
#define S1 sep, ls[++i]
|
||||
#define S4 S1, S1, S1, S1
|
||||
#define S16 S4, S4, S4, S4
|
||||
#define S64 S16, S16, S16, S16
|
||||
|
||||
. = "[ls[++i]]" // Make sure the initial element is converted to text.
|
||||
|
||||
// Having the small concatenations come before the large ones boosted speed by an average of at least 5%.
|
||||
if (l-1 & 0x01) // 'i' will always be 1 here.
|
||||
. = text("[][][]", ., S1) // Append 1 element if the remaining elements are not a multiple of 2.
|
||||
if (l-i & 0x02)
|
||||
. = text("[][][][][]", ., S1, S1) // Append 2 elements if the remaining elements are not a multiple of 4.
|
||||
if (l-i & 0x04)
|
||||
. = text("[][][][][][][][][]", ., S4) // And so on....
|
||||
if (l-i & 0x08)
|
||||
. = text("[][][][][][][][][][][][][][][][][]", ., S4, S4)
|
||||
if (l-i & 0x10)
|
||||
. = text("[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S16)
|
||||
if (l-i & 0x20)
|
||||
. = text("[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S16, S16)
|
||||
if (l-i & 0x40)
|
||||
. = text("[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S64)
|
||||
while (l > i) // Chomp through the rest of the list, 128 elements at a time.
|
||||
. = text("[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S64, S64)
|
||||
|
||||
#undef S64
|
||||
#undef S16
|
||||
#undef S4
|
||||
#undef S1
|
||||
else
|
||||
// Macros expand to long argument lists like so: ls[++i], ls[++i], ls[++i], etc...
|
||||
#define S1 ls[++i]
|
||||
#define S4 S1, S1, S1, S1
|
||||
#define S16 S4, S4, S4, S4
|
||||
#define S64 S16, S16, S16, S16
|
||||
|
||||
. = "[ls[++i]]" // Make sure the initial element is converted to text.
|
||||
|
||||
if (l-1 & 0x01) // 'i' will always be 1 here.
|
||||
. += S1 // Append 1 element if the remaining elements are not a multiple of 2.
|
||||
if (l-i & 0x02)
|
||||
. = text("[][][]", ., S1, S1) // Append 2 elements if the remaining elements are not a multiple of 4.
|
||||
if (l-i & 0x04)
|
||||
. = text("[][][][][]", ., S4) // And so on...
|
||||
if (l-i & 0x08)
|
||||
. = text("[][][][][][][][][]", ., S4, S4)
|
||||
if (l-i & 0x10)
|
||||
. = text("[][][][][][][][][][][][][][][][][]", ., S16)
|
||||
if (l-i & 0x20)
|
||||
. = text("[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S16, S16)
|
||||
if (l-i & 0x40)
|
||||
. = text("[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S64)
|
||||
while (l > i) // Chomp through the rest of the list, 128 elements at a time.
|
||||
. = text("[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S64, S64)
|
||||
|
||||
#undef S64
|
||||
#undef S16
|
||||
#undef S4
|
||||
#undef S1
|
||||
|
||||
// Converts a string into a list by splitting the string at each delimiter found. (discarding the seperator)
|
||||
/proc/splittext(text, delimiter="\n")
|
||||
var/delim_len = length(delimiter)
|
||||
if (delim_len < 1)
|
||||
return list(text)
|
||||
|
||||
. = list()
|
||||
var/last_found = 1
|
||||
var/found
|
||||
|
||||
do
|
||||
found = findtext(text, delimiter, last_found, 0)
|
||||
. += copytext(text, last_found, found)
|
||||
last_found = found + delim_len
|
||||
while (found)
|
||||
#endif
|
||||
@@ -2,11 +2,8 @@
|
||||
* Holds procs designed to change one type of value, into another.
|
||||
* Contains:
|
||||
* hex2num & num2hex
|
||||
* text2list & list2text
|
||||
* file2list
|
||||
* angle2dir
|
||||
* angle2text
|
||||
* worldtime2text
|
||||
*/
|
||||
|
||||
// Returns an integer given a hexadecimal number string as input.
|
||||
@@ -133,10 +130,6 @@
|
||||
if (NORTHWEST) return 315
|
||||
if (SOUTHWEST) return 225
|
||||
|
||||
// Returns the angle in english
|
||||
/proc/angle2text(var/degree)
|
||||
return dir2text(angle2dir(degree))
|
||||
|
||||
// Converts a blend_mode constant to one acceptable to icon.Blend()
|
||||
/proc/blendMode2iconMode(blend_mode)
|
||||
switch (blend_mode)
|
||||
@@ -294,107 +287,6 @@
|
||||
return strtype
|
||||
return copytext(strtype, delim_pos)
|
||||
|
||||
// Concatenates a list of strings into a single string. A seperator may optionally be provided.
|
||||
/proc/list2text(list/ls, sep)
|
||||
if (ls.len <= 1) // Early-out code for empty or singleton lists.
|
||||
return ls.len ? ls[1] : ""
|
||||
|
||||
var/l = ls.len // Made local for sanic speed.
|
||||
var/i = 0 // Incremented every time a list index is accessed.
|
||||
|
||||
if (sep != null)
|
||||
// Macros expand to long argument lists like so: sep, ls[++i], sep, ls[++i], sep, ls[++i], etc...
|
||||
#define S1 sep, ls[++i]
|
||||
#define S4 S1, S1, S1, S1
|
||||
#define S16 S4, S4, S4, S4
|
||||
#define S64 S16, S16, S16, S16
|
||||
|
||||
. = "[ls[++i]]" // Make sure the initial element is converted to text.
|
||||
|
||||
// Having the small concatenations come before the large ones boosted speed by an average of at least 5%.
|
||||
if (l-1 & 0x01) // 'i' will always be 1 here.
|
||||
. = text("[][][]", ., S1) // Append 1 element if the remaining elements are not a multiple of 2.
|
||||
if (l-i & 0x02)
|
||||
. = text("[][][][][]", ., S1, S1) // Append 2 elements if the remaining elements are not a multiple of 4.
|
||||
if (l-i & 0x04)
|
||||
. = text("[][][][][][][][][]", ., S4) // And so on....
|
||||
if (l-i & 0x08)
|
||||
. = text("[][][][][][][][][][][][][][][][][]", ., S4, S4)
|
||||
if (l-i & 0x10)
|
||||
. = text("[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S16)
|
||||
if (l-i & 0x20)
|
||||
. = text("[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S16, S16)
|
||||
if (l-i & 0x40)
|
||||
. = text("[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S64)
|
||||
while (l > i) // Chomp through the rest of the list, 128 elements at a time.
|
||||
. = text("[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S64, S64)
|
||||
|
||||
#undef S64
|
||||
#undef S16
|
||||
#undef S4
|
||||
#undef S1
|
||||
else
|
||||
// Macros expand to long argument lists like so: ls[++i], ls[++i], ls[++i], etc...
|
||||
#define S1 ls[++i]
|
||||
#define S4 S1, S1, S1, S1
|
||||
#define S16 S4, S4, S4, S4
|
||||
#define S64 S16, S16, S16, S16
|
||||
|
||||
. = "[ls[++i]]" // Make sure the initial element is converted to text.
|
||||
|
||||
if (l-1 & 0x01) // 'i' will always be 1 here.
|
||||
. += S1 // Append 1 element if the remaining elements are not a multiple of 2.
|
||||
if (l-i & 0x02)
|
||||
. = text("[][][]", ., S1, S1) // Append 2 elements if the remaining elements are not a multiple of 4.
|
||||
if (l-i & 0x04)
|
||||
. = text("[][][][][]", ., S4) // And so on...
|
||||
if (l-i & 0x08)
|
||||
. = text("[][][][][][][][][]", ., S4, S4)
|
||||
if (l-i & 0x10)
|
||||
. = text("[][][][][][][][][][][][][][][][][]", ., S16)
|
||||
if (l-i & 0x20)
|
||||
. = text("[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S16, S16)
|
||||
if (l-i & 0x40)
|
||||
. = text("[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S64)
|
||||
while (l > i) // Chomp through the rest of the list, 128 elements at a time.
|
||||
. = text("[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S64, S64)
|
||||
|
||||
#undef S64
|
||||
#undef S16
|
||||
#undef S4
|
||||
#undef S1
|
||||
|
||||
// Converts a string into a list by splitting the string at each delimiter found. (discarding the seperator)
|
||||
/proc/text2list(text, delimiter="\n")
|
||||
var/delim_len = length(delimiter)
|
||||
if (delim_len < 1)
|
||||
return list(text)
|
||||
|
||||
. = list()
|
||||
var/last_found = 1
|
||||
var/found
|
||||
|
||||
do
|
||||
found = findtext(text, delimiter, last_found, 0)
|
||||
. += copytext(text, last_found, found)
|
||||
last_found = found + delim_len
|
||||
while (found)
|
||||
|
||||
/proc/type2parent(child)
|
||||
var/string_type = "[child]"
|
||||
var/last_slash = findlasttext(string_type, "/")
|
||||
|
||||
@@ -196,9 +196,6 @@ Turf and target are seperate in case you want to teleport some distance from a t
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/proc/sign(x)
|
||||
return x!=0?x/abs(x):0
|
||||
|
||||
/proc/getline(atom/M,atom/N)//Ultra-Fast Bresenham Line-Drawing Algorithm
|
||||
var/px=M.x //starting x
|
||||
var/py=M.y
|
||||
@@ -207,8 +204,8 @@ Turf and target are seperate in case you want to teleport some distance from a t
|
||||
var/dy=N.y-py
|
||||
var/dxabs=abs(dx)//Absolute value of x distance
|
||||
var/dyabs=abs(dy)
|
||||
var/sdx=sign(dx) //Sign of x distance (+ or -)
|
||||
var/sdy=sign(dy)
|
||||
var/sdx=SIGN(dx) //Sign of x distance (+ or -)
|
||||
var/sdy=SIGN(dy)
|
||||
var/x=dxabs>>1 //Counters for steps taken, setting to distance/2
|
||||
var/y=dyabs>>1 //Bit-shifting makes me l33t. It also makes getline() unnessecarrily fast.
|
||||
var/j //Generic integer for counting
|
||||
@@ -426,34 +423,6 @@ Turf and target are seperate in case you want to teleport some distance from a t
|
||||
else . = pick(ais)
|
||||
return .
|
||||
|
||||
/proc/get_sorted_mobs()
|
||||
var/list/old_list = getmobs()
|
||||
var/list/AI_list = list()
|
||||
var/list/Dead_list = list()
|
||||
var/list/keyclient_list = list()
|
||||
var/list/key_list = list()
|
||||
var/list/logged_list = list()
|
||||
for(var/named in old_list)
|
||||
var/mob/M = old_list[named]
|
||||
if(issilicon(M))
|
||||
AI_list |= M
|
||||
else if(isobserver(M) || M.stat == 2)
|
||||
Dead_list |= M
|
||||
else if(M.key && M.client)
|
||||
keyclient_list |= M
|
||||
else if(M.key)
|
||||
key_list |= M
|
||||
else
|
||||
logged_list |= M
|
||||
old_list.Remove(named)
|
||||
var/list/new_list = list()
|
||||
new_list += AI_list
|
||||
new_list += keyclient_list
|
||||
new_list += key_list
|
||||
new_list += logged_list
|
||||
new_list += Dead_list
|
||||
return new_list
|
||||
|
||||
//Returns a list of all mobs with their name
|
||||
/proc/getmobs()
|
||||
return observe_list_format(sortmobs())
|
||||
@@ -528,14 +497,6 @@ Turf and target are seperate in case you want to teleport some distance from a t
|
||||
return "[round((powerused * 0.000001),0.001)] MW"
|
||||
return "[round((powerused * 0.000000001),0.0001)] GW"
|
||||
|
||||
/proc/get_mob_by_ckey(key)
|
||||
if(!key)
|
||||
return
|
||||
var/list/mobs = sortmobs()
|
||||
for(var/mob/M in mobs)
|
||||
if(M.ckey == key)
|
||||
return M
|
||||
|
||||
//Forces a variable to be posative
|
||||
/proc/modulus(var/M)
|
||||
if(M >= 0)
|
||||
@@ -648,34 +609,6 @@ Turf and target are seperate in case you want to teleport some distance from a t
|
||||
cant_pass = 1
|
||||
return cant_pass
|
||||
|
||||
/proc/get_step_towards2(var/atom/ref , var/atom/trg)
|
||||
var/base_dir = get_dir(ref, get_step_towards(ref,trg))
|
||||
var/turf/temp = get_step_towards(ref,trg)
|
||||
|
||||
if(is_blocked_turf(temp))
|
||||
var/dir_alt1 = turn(base_dir, 90)
|
||||
var/dir_alt2 = turn(base_dir, -90)
|
||||
var/turf/turf_last1 = temp
|
||||
var/turf/turf_last2 = temp
|
||||
var/free_tile = null
|
||||
var/breakpoint = 0
|
||||
|
||||
while(!free_tile && breakpoint < 10)
|
||||
if(!is_blocked_turf(turf_last1))
|
||||
free_tile = turf_last1
|
||||
break
|
||||
if(!is_blocked_turf(turf_last2))
|
||||
free_tile = turf_last2
|
||||
break
|
||||
turf_last1 = get_step(turf_last1,dir_alt1)
|
||||
turf_last2 = get_step(turf_last2,dir_alt2)
|
||||
breakpoint++
|
||||
|
||||
if(!free_tile) return get_step(ref, base_dir)
|
||||
else return get_step_towards(ref,free_tile)
|
||||
|
||||
else return get_step(ref, base_dir)
|
||||
|
||||
//Takes: Anything that could possibly have variables and a varname to check.
|
||||
//Returns: 1 if found, 0 if not.
|
||||
/proc/hasvar(var/datum/A, var/varname)
|
||||
@@ -693,20 +626,6 @@ Turf and target are seperate in case you want to teleport some distance from a t
|
||||
/proc/return_sorted_areas()
|
||||
return sortTim(return_areas(), /proc/cmp_text_asc)
|
||||
|
||||
//Takes: Area type as text string or as typepath OR an instance of the area.
|
||||
//Returns: A list of all areas of that type in the world.
|
||||
/proc/get_areas(var/areatype)
|
||||
if(!areatype) return null
|
||||
if(istext(areatype)) areatype = text2path(areatype)
|
||||
if(isarea(areatype))
|
||||
var/area/areatemp = areatype
|
||||
areatype = areatemp.type
|
||||
|
||||
var/list/areas = new/list()
|
||||
for(var/area/N in world)
|
||||
if(istype(N, areatype)) areas += N
|
||||
return areas
|
||||
|
||||
//Takes: Area type as text string or as typepath OR an instance of the area.
|
||||
//Returns: A list of all turfs in areas of that type of that type in the world.
|
||||
/proc/get_area_turfs(var/areatype)
|
||||
@@ -1021,10 +940,6 @@ Turf and target are seperate in case you want to teleport some distance from a t
|
||||
var/dy = abs(B.y - A.y)
|
||||
return get_dir(A, B) & (rand() * (dx+dy) < dy ? 3 : 12)
|
||||
|
||||
//chances are 1:value. anyprob(1) will always return true
|
||||
/proc/anyprob(value)
|
||||
return (rand(1,value)==value)
|
||||
|
||||
/proc/view_or_range(distance = world.view , center = usr , type)
|
||||
switch(type)
|
||||
if("view")
|
||||
@@ -1033,14 +948,6 @@ Turf and target are seperate in case you want to teleport some distance from a t
|
||||
. = range(distance,center)
|
||||
return
|
||||
|
||||
/proc/oview_or_orange(distance = world.view , center = usr , type)
|
||||
switch(type)
|
||||
if("view")
|
||||
. = oview(distance,center)
|
||||
if("range")
|
||||
. = orange(distance,center)
|
||||
return
|
||||
|
||||
/proc/get_mob_with_client_list()
|
||||
var/list/mobs = list()
|
||||
for(var/mob/M in mob_list)
|
||||
@@ -1162,16 +1069,6 @@ var/global/list/common_tools = list(
|
||||
istype(W, /obj/item/weapon/shovel) \
|
||||
)
|
||||
|
||||
/proc/is_surgery_tool(obj/item/W as obj)
|
||||
return ( \
|
||||
istype(W, /obj/item/weapon/surgical/scalpel) || \
|
||||
istype(W, /obj/item/weapon/surgical/hemostat) || \
|
||||
istype(W, /obj/item/weapon/surgical/retractor) || \
|
||||
istype(W, /obj/item/weapon/surgical/cautery) || \
|
||||
istype(W, /obj/item/weapon/surgical/bonegel) || \
|
||||
istype(W, /obj/item/weapon/surgical/bonesetter)
|
||||
)
|
||||
|
||||
// check if mob is lying down on something we can operate him on.
|
||||
// The RNG with table/rollerbeds comes into play in do_surgery() so that fail_step() can be used instead.
|
||||
/proc/can_operate(mob/living/carbon/M)
|
||||
@@ -1184,29 +1081,13 @@ var/global/list/common_tools = list(
|
||||
var/obj/surface = null
|
||||
for(var/obj/O in loc) // Looks for the best surface.
|
||||
if(O.surgery_odds)
|
||||
if(!surface || surface.surgery_odds < O)
|
||||
if(!surface || surface.surgery_odds < O.surgery_odds)
|
||||
surface = O
|
||||
if(surface)
|
||||
return surface
|
||||
|
||||
/proc/reverse_direction(var/dir)
|
||||
switch(dir)
|
||||
if(NORTH)
|
||||
return SOUTH
|
||||
if(NORTHEAST)
|
||||
return SOUTHWEST
|
||||
if(EAST)
|
||||
return WEST
|
||||
if(SOUTHEAST)
|
||||
return NORTHWEST
|
||||
if(SOUTH)
|
||||
return NORTH
|
||||
if(SOUTHWEST)
|
||||
return NORTHEAST
|
||||
if(WEST)
|
||||
return EAST
|
||||
if(NORTHWEST)
|
||||
return SOUTHEAST
|
||||
return global.reverse_dir[dir]
|
||||
|
||||
/*
|
||||
Checks if that loc and dir has a item on the wall
|
||||
@@ -1323,16 +1204,12 @@ var/mob/dview/dview_mob = new
|
||||
living_mob_list -= src
|
||||
|
||||
/mob/dview/Destroy(var/force)
|
||||
crash_with("Attempt to delete the dview_mob: [log_info_line(src)]")
|
||||
stack_trace("Attempt to delete the dview_mob: [log_info_line(src)]")
|
||||
if (!force)
|
||||
return QDEL_HINT_LETMELIVE
|
||||
global.dview_mob = new
|
||||
return ..()
|
||||
|
||||
// call to generate a stack trace and print to runtime logs
|
||||
/proc/crash_with(msg)
|
||||
CRASH(msg)
|
||||
|
||||
/proc/screen_loc2turf(scr_loc, turf/origin)
|
||||
var/tX = splittext(scr_loc, ",")
|
||||
var/tY = splittext(tX[2], ":")
|
||||
@@ -1478,9 +1355,6 @@ var/mob/dview/dview_mob = new
|
||||
if(337.5)
|
||||
return "North-Northwest"
|
||||
|
||||
/proc/pass()
|
||||
return
|
||||
|
||||
/proc/pick_closest_path(value, list/matches = get_fancy_list_of_atom_types())
|
||||
if (value == FALSE) //nothing should be calling us with a number, so this is safe
|
||||
value = input(usr, "Enter type to find (blank for all, cancel to cancel)", "Search for type") as null|text
|
||||
|
||||
@@ -20,7 +20,7 @@ GLOBAL_REAL(GLOB, /datum/controller/global_vars)
|
||||
Initialize(exclude_these)
|
||||
|
||||
/datum/controller/global_vars/Destroy(force)
|
||||
crash_with("There was an attempt to qdel the global vars holder!")
|
||||
stack_trace("There was an attempt to qdel the global vars holder!")
|
||||
if(!force)
|
||||
return QDEL_HINT_LETMELIVE
|
||||
|
||||
|
||||
@@ -112,9 +112,9 @@ SUBSYSTEM_DEF(processing)
|
||||
var/tick_time = world.time - start_tick
|
||||
var/tick_use_limit = world.tick_usage - start_tick_usage - 100 // Current tick use - starting tick use - 100% (a full tick excess)
|
||||
if(tick_time > 0)
|
||||
crash_with("[log_info_line(subsystem.debug_last_thing)] slept during processing. Spent [tick_time] tick\s.")
|
||||
stack_trace("[log_info_line(subsystem.debug_last_thing)] slept during processing. Spent [tick_time] tick\s.")
|
||||
if(tick_use_limit > 0)
|
||||
crash_with("[log_info_line(subsystem.debug_last_thing)] took longer than a tick to process. Exceeded with [tick_use_limit]%")
|
||||
stack_trace("[log_info_line(subsystem.debug_last_thing)] took longer than a tick to process. Exceeded with [tick_use_limit]%")
|
||||
|
||||
/datum/proc/process()
|
||||
set waitfor = 0
|
||||
|
||||
@@ -159,7 +159,7 @@ SUBSYSTEM_DEF(timer)
|
||||
|
||||
if (timer.timeToRun < head_offset)
|
||||
bucket_resolution = null //force bucket recreation
|
||||
crash_with("[i] Invalid timer state: Timer in long run queue with a time to run less then head_offset. [get_timer_debug_string(timer)] world.time: [world.time], head_offset: [head_offset], practical_offset: [practical_offset]")
|
||||
stack_trace("[i] Invalid timer state: Timer in long run queue with a time to run less then head_offset. [get_timer_debug_string(timer)] world.time: [world.time], head_offset: [head_offset], practical_offset: [practical_offset]")
|
||||
if (timer.callBack && !timer.spent)
|
||||
timer.callBack.InvokeAsync()
|
||||
spent += timer
|
||||
@@ -170,7 +170,7 @@ SUBSYSTEM_DEF(timer)
|
||||
|
||||
if (timer.timeToRun < head_offset + TICKS2DS(practical_offset-1))
|
||||
bucket_resolution = null //force bucket recreation
|
||||
crash_with("[i] Invalid timer state: Timer in long run queue that would require a backtrack to transfer to short run queue. [get_timer_debug_string(timer)] world.time: [world.time], head_offset: [head_offset], practical_offset: [practical_offset]")
|
||||
stack_trace("[i] Invalid timer state: Timer in long run queue that would require a backtrack to transfer to short run queue. [get_timer_debug_string(timer)] world.time: [world.time], head_offset: [head_offset], practical_offset: [practical_offset]")
|
||||
if (timer.callBack && !timer.spent)
|
||||
timer.callBack.InvokeAsync()
|
||||
spent += timer
|
||||
@@ -458,10 +458,10 @@ SUBSYSTEM_DEF(timer)
|
||||
CRASH("addtimer called without a callback")
|
||||
|
||||
if (wait < 0)
|
||||
crash_with("addtimer called with a negative wait. Converting to [world.tick_lag]")
|
||||
stack_trace("addtimer called with a negative wait. Converting to [world.tick_lag]")
|
||||
|
||||
if (callback.object != GLOBAL_PROC && QDELETED(callback.object) && !QDESTROYING(callback.object))
|
||||
crash_with("addtimer called with a callback assigned to a qdeleted object. In the future such timers will not be supported and may refuse to run or run with a 0 wait")
|
||||
stack_trace("addtimer called with a callback assigned to a qdeleted object. In the future such timers will not be supported and may refuse to run or run with a 0 wait")
|
||||
|
||||
wait = max(CEILING(wait, world.tick_lag), world.tick_lag)
|
||||
|
||||
@@ -492,7 +492,7 @@ SUBSYSTEM_DEF(timer)
|
||||
. = hash_timer.id
|
||||
return
|
||||
else if(flags & TIMER_OVERRIDE)
|
||||
crash_with("TIMER_OVERRIDE used without TIMER_UNIQUE")
|
||||
stack_trace("TIMER_OVERRIDE used without TIMER_UNIQUE")
|
||||
|
||||
var/datum/timedevent/timer = new(callback, wait, flags, hash)
|
||||
return timer.id
|
||||
|
||||
@@ -16,10 +16,10 @@ GLOBAL_VAR(managed_browser_id_ticker)
|
||||
|
||||
/datum/managed_browser/New(client/new_client)
|
||||
if(!new_client)
|
||||
crash_with("Managed browser object was not given a client.")
|
||||
stack_trace("Managed browser object was not given a client.")
|
||||
return
|
||||
if(!base_browser_id)
|
||||
crash_with("Managed browser object does not have a base browser id defined in its type.")
|
||||
stack_trace("Managed browser object does not have a base browser id defined in its type.")
|
||||
return
|
||||
|
||||
my_client = new_client
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
/datum/data/record/Destroy(var/force)
|
||||
if(data_core.locked.Find(src))
|
||||
if(!force)
|
||||
crash_with("Someone tried to qdel a record that was in data_core.locked [log_info_line(src)]")
|
||||
stack_trace("Someone tried to qdel a record that was in data_core.locked [log_info_line(src)]")
|
||||
return QDEL_HINT_LETMELIVE
|
||||
data_core.locked -= src
|
||||
data_core.medical -= src
|
||||
|
||||
@@ -67,5 +67,5 @@ var/repository/decls/decls_repository // Initialiozed in /datum/global_init/New(
|
||||
|
||||
/decl/Destroy()
|
||||
SHOULD_CALL_PARENT(FALSE)
|
||||
crash_with("Prevented attempt to delete a decl instance: [log_info_line(src)]")
|
||||
stack_trace("Prevented attempt to delete a decl instance: [log_info_line(src)]")
|
||||
return QDEL_HINT_LETMELIVE // Prevents decl destruction
|
||||
|
||||
@@ -83,9 +83,9 @@
|
||||
// Must return an Initialize hint. Defined in code/__defines/subsystems.dm
|
||||
/atom/proc/Initialize(mapload, ...)
|
||||
if(QDELETED(src))
|
||||
crash_with("GC: -- [type] had initialize() called after qdel() --")
|
||||
stack_trace("GC: -- [type] had initialize() called after qdel() --")
|
||||
if(initialized)
|
||||
crash_with("Warning: [src]([type]) initialized multiple times!")
|
||||
stack_trace("Warning: [src]([type]) initialized multiple times!")
|
||||
initialized = TRUE
|
||||
return INITIALIZE_HINT_NORMAL
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
..()
|
||||
if(id_tag)
|
||||
if(SSshuttles.docking_registry[id_tag])
|
||||
crash_with("Docking controller tag [id_tag] had multiple associated programs.")
|
||||
stack_trace("Docking controller tag [id_tag] had multiple associated programs.")
|
||||
SSshuttles.docking_registry[id_tag] = src
|
||||
|
||||
/datum/embedded_program/docking/Destroy()
|
||||
|
||||
@@ -201,7 +201,7 @@ when portals are shortly lived, or when portals are made to be obvious with spec
|
||||
break
|
||||
|
||||
if(!counterpart)
|
||||
crash_with("Portal master [type] ([x],[y],[z]) could not find another portal master with a matching portal_id ([portal_id]).")
|
||||
stack_trace("Portal master [type] ([x],[y],[z]) could not find another portal master with a matching portal_id ([portal_id]).")
|
||||
|
||||
/obj/effect/map_effect/portal/master/proc/make_visuals()
|
||||
var/list/observed_turfs = list()
|
||||
|
||||
@@ -172,7 +172,7 @@
|
||||
if(istype(mover)) // turf/Enter(...) will perform more advanced checks
|
||||
return !density
|
||||
|
||||
crash_with("Non movable passed to turf CanPass : [mover]")
|
||||
stack_trace("Non movable passed to turf CanPass : [mover]")
|
||||
return FALSE
|
||||
|
||||
//There's a lot of QDELETED() calls here if someone can figure out how to optimize this but not runtime when something gets deleted by a Bump/CanPass/Cross call, lemme know or go ahead and fix this mess - kevinz000
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//#define TESTING
|
||||
#if DM_VERSION < 506
|
||||
#warn This compiler is out of date. You may experience issues with projectile animations.
|
||||
#if DM_VERSION < 512
|
||||
#error This compiler is out of date Please update to at least BYOND 512.
|
||||
#endif
|
||||
|
||||
// Items that ask to be called every cycle.
|
||||
|
||||
@@ -506,7 +506,7 @@
|
||||
if (!S)
|
||||
continue
|
||||
|
||||
words |= text2list(S.name," ")
|
||||
words |= splittext(S.name," ")
|
||||
cooktypes |= S.cooked
|
||||
|
||||
if (S.reagents && S.reagents.total_volume > 0)
|
||||
|
||||
@@ -56,9 +56,9 @@
|
||||
// Sanity checks - Better to generate a helpful error message now than have DrawBox() runtime
|
||||
var/icon/canvas = icon(HOLOMAP_ICON, "blank")
|
||||
if(world.maxx > canvas.Width())
|
||||
crash_with("Minimap for z=[zLevel] : world.maxx ([world.maxx]) must be <= [canvas.Width()]")
|
||||
stack_trace("Minimap for z=[zLevel] : world.maxx ([world.maxx]) must be <= [canvas.Width()]")
|
||||
if(world.maxy > canvas.Height())
|
||||
crash_with("Minimap for z=[zLevel] : world.maxy ([world.maxy]) must be <= [canvas.Height()]")
|
||||
stack_trace("Minimap for z=[zLevel] : world.maxy ([world.maxy]) must be <= [canvas.Height()]")
|
||||
|
||||
for(var/x = 1 to world.maxx)
|
||||
for(var/y = 1 to world.maxy)
|
||||
@@ -82,9 +82,9 @@
|
||||
// Sanity checks - Better to generate a helpful error message now than have DrawBox() runtime
|
||||
var/icon/canvas = icon(HOLOMAP_ICON, "blank")
|
||||
if(world.maxx > canvas.Width())
|
||||
crash_with("Minimap for z=[zLevel] : world.maxx ([world.maxx]) must be <= [canvas.Width()]")
|
||||
stack_trace("Minimap for z=[zLevel] : world.maxx ([world.maxx]) must be <= [canvas.Width()]")
|
||||
if(world.maxy > canvas.Height())
|
||||
crash_with("Minimap for z=[zLevel] : world.maxy ([world.maxy]) must be <= [canvas.Height()]")
|
||||
stack_trace("Minimap for z=[zLevel] : world.maxy ([world.maxy]) must be <= [canvas.Height()]")
|
||||
|
||||
for(var/x = 1 to world.maxx)
|
||||
for(var/y = 1 to world.maxy)
|
||||
|
||||
@@ -107,7 +107,7 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon()
|
||||
if(QDESTROYING(src))
|
||||
return
|
||||
|
||||
crash_with("CANARY: Old human update_icons was called.")
|
||||
stack_trace("CANARY: Old human update_icons was called.")
|
||||
|
||||
update_hud() //TODO: remove the need for this
|
||||
|
||||
@@ -839,7 +839,7 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon()
|
||||
apply_layer(SUIT_LAYER)
|
||||
|
||||
/mob/living/carbon/human/update_inv_pockets()
|
||||
crash_with("Someone called update_inv_pockets even though it's dumb")
|
||||
stack_trace("Someone called update_inv_pockets even though it's dumb")
|
||||
|
||||
/mob/living/carbon/human/update_inv_wear_mask()
|
||||
if(QDESTROYING(src))
|
||||
|
||||
@@ -228,21 +228,21 @@
|
||||
|
||||
if(!delivery && compactor && length(contents))//garbage counter for trashpup
|
||||
dat += "<font color='red'><B>Current load:</B> [length(contents)] / [max_item_count] objects.</font><BR>"
|
||||
dat += "<font color='gray'>([list2text(contents,", ")])</font><BR><BR>"
|
||||
dat += "<font color='gray'>([contents.Join(", ")])</font><BR><BR>"
|
||||
|
||||
if(delivery && length(contents))
|
||||
dat += "<font color='red'><B>Current load:</B> [length(contents)] / [max_item_count] objects.</font><BR>"
|
||||
dat += "<font color='gray'>Cargo compartment slot: Cargo 1.</font><BR>"
|
||||
if(length(deliveryslot_1))
|
||||
dat += "<font color='gray'>([list2text(deliveryslot_1,", ")])</font><BR>"
|
||||
dat += "<font color='gray'>([deliveryslot_1.Join(", ")])</font><BR>"
|
||||
dat += "<font color='gray'>Cargo compartment slot: Cargo 2.</font><BR>"
|
||||
if(length(deliveryslot_2))
|
||||
dat += "<font color='gray'>([list2text(deliveryslot_2,", ")])</font><BR>"
|
||||
dat += "<font color='gray'>([deliveryslot_2.Join(", ")])</font><BR>"
|
||||
dat += "<font color='gray'>Cargo compartment slot: Cargo 3.</font><BR>"
|
||||
if(length(deliveryslot_3))
|
||||
dat += "<font color='gray'>([list2text(deliveryslot_3,", ")])</font><BR>"
|
||||
dat += "<font color='gray'>([deliveryslot_3.Join(", ")])</font><BR>"
|
||||
dat += "<font color='red'>Cargo compartment slot: Fuel.</font><BR>"
|
||||
dat += "<font color='red'>([list2text(contents - (deliveryslot_1 + deliveryslot_2 + deliveryslot_3),", ")])</font><BR><BR>"
|
||||
dat += "<font color='red'>([jointext(contents - (deliveryslot_1 + deliveryslot_2 + deliveryslot_3),", ")])</font><BR><BR>"
|
||||
|
||||
if(analyzer && !synced)
|
||||
dat += "<A href='?src=\ref[src];sync=1'>Sync Files</A><BR>"
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
ASSERT(which)
|
||||
var/obj/screen/plane_master/PM = plane_masters[which]
|
||||
if(!PM)
|
||||
crash_with("Tried to alter [which] in plane_holder on [my_mob]!")
|
||||
stack_trace("Tried to alter [which] in plane_holder on [my_mob]!")
|
||||
|
||||
if(my_mob.alpha <= EFFECTIVE_INVIS)
|
||||
state = FALSE
|
||||
@@ -83,7 +83,7 @@
|
||||
ASSERT(which)
|
||||
var/obj/screen/plane_master/PM = plane_masters[which]
|
||||
if(!PM)
|
||||
crash_with("Tried to alter [which] in plane_holder on [my_mob]!")
|
||||
stack_trace("Tried to alter [which] in plane_holder on [my_mob]!")
|
||||
PM.set_desired_alpha(new_alpha)
|
||||
if(PM.sub_planes)
|
||||
var/list/subplanes = PM.sub_planes
|
||||
@@ -94,7 +94,7 @@
|
||||
ASSERT(which)
|
||||
var/obj/screen/plane_master/PM = plane_masters[which]
|
||||
if(!PM)
|
||||
crash_with("Tried to set_ao [which] in plane_holder on [my_mob]!")
|
||||
stack_trace("Tried to set_ao [which] in plane_holder on [my_mob]!")
|
||||
PM.set_ambient_occlusion(enabled)
|
||||
if(PM.sub_planes)
|
||||
var/list/subplanes = PM.sub_planes
|
||||
@@ -105,7 +105,7 @@
|
||||
ASSERT(which)
|
||||
var/obj/screen/plane_master/PM = plane_masters[which]
|
||||
if(!PM)
|
||||
crash_with("Tried to alter [which] in plane_holder on [my_mob]!")
|
||||
stack_trace("Tried to alter [which] in plane_holder on [my_mob]!")
|
||||
PM.alter_plane_values(arglist(values))
|
||||
if(PM.sub_planes)
|
||||
var/list/subplanes = PM.sub_planes
|
||||
|
||||
@@ -98,7 +98,7 @@
|
||||
H_fuel = 0
|
||||
antiH_fuel = 0
|
||||
else
|
||||
var/residual_matter = modulus(H_fuel - antiH_fuel)
|
||||
var/residual_matter = abs(H_fuel - antiH_fuel)
|
||||
var/mass = antiH_fuel + H_fuel - residual_matter
|
||||
energy = convert2energy(mass)
|
||||
if( H_fuel > antiH_fuel )
|
||||
@@ -149,7 +149,7 @@
|
||||
else //else if they're not equal determine which isn't equal
|
||||
//and set it equal to either H or antiH so we don't lose anything
|
||||
|
||||
var/residual_matter = modulus(H_fuel - antiH_fuel)
|
||||
var/residual_matter = abs(H_fuel - antiH_fuel)
|
||||
mass = antiH_fuel + H_fuel - residual_matter
|
||||
energy = convert2energy(mass)
|
||||
|
||||
|
||||
@@ -323,7 +323,7 @@
|
||||
var/turf/starting = get_turf(src)
|
||||
if(isnull(Angle)) //Try to resolve through offsets if there's no angle set.
|
||||
if(isnull(xo) || isnull(yo))
|
||||
crash_with("WARNING: Projectile [type] deleted due to being unable to resolve a target after angle was null!")
|
||||
stack_trace("WARNING: Projectile [type] deleted due to being unable to resolve a target after angle was null!")
|
||||
qdel(src)
|
||||
return
|
||||
var/turf/target = locate(CLAMP(starting + xo, 1, world.maxx), CLAMP(starting + yo, 1, world.maxy), starting.z)
|
||||
@@ -400,7 +400,7 @@
|
||||
xo = targloc.x - curloc.x
|
||||
setAngle(Get_Angle(src, targloc) + spread)
|
||||
else
|
||||
crash_with("WARNING: Projectile [type] fired without either mouse parameters, or a target atom to aim at!")
|
||||
stack_trace("WARNING: Projectile [type] fired without either mouse parameters, or a target atom to aim at!")
|
||||
qdel(src)
|
||||
|
||||
/proc/calculate_projectile_angle_and_pixel_offsets(mob/user, params)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -15,7 +15,7 @@
|
||||
for(var/id in dispense_reagents)
|
||||
var/datum/reagent/R = SSchemistry.chemical_reagents[id]
|
||||
if(!R)
|
||||
crash_with("[src] at [x],[y],[z] failed to find reagent '[id]'!")
|
||||
stack_trace("[src] at [x],[y],[z] failed to find reagent '[id]'!")
|
||||
dispense_reagents -= id
|
||||
continue
|
||||
var/obj/item/weapon/reagent_containers/chem_disp_cartridge/C = cartridges[R.name]
|
||||
|
||||
@@ -165,7 +165,7 @@
|
||||
return
|
||||
|
||||
if(!damtype)
|
||||
crash_with("CANARY: shield.take_damage() callled without damtype.")
|
||||
stack_trace("CANARY: shield.take_damage() callled without damtype.")
|
||||
|
||||
if(!damage)
|
||||
return
|
||||
|
||||
@@ -510,7 +510,7 @@
|
||||
|
||||
var/messages = null
|
||||
if(raw_messages)
|
||||
messages = list2text(raw_messages, delim)
|
||||
messages = raw_messages.Join(delim)
|
||||
return messages
|
||||
|
||||
// The next function sets the messages on the belly, from human-readable var
|
||||
@@ -519,7 +519,7 @@
|
||||
/obj/belly/proc/set_messages(raw_text, type, delim = "\n\n")
|
||||
ASSERT(type == "smo" || type == "smi" || type == "dmo" || type == "dmp" || type == "em" || type == "ema" || type == "im_digest" || type == "im_hold" || type == "im_absorb" || type == "im_heal" || type == "im_drain")
|
||||
|
||||
var/list/raw_list = text2list(html_encode(raw_text),delim)
|
||||
var/list/raw_list = splittext(html_encode(raw_text),delim)
|
||||
if(raw_list.len > 10)
|
||||
raw_list.Cut(11)
|
||||
log_debug("[owner] tried to set [lowertext(name)] with 11+ messages")
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
*/
|
||||
/proc/prep_for_persist(var/mob/persister)
|
||||
if(!istype(persister))
|
||||
crash_with("Persist (P4P): Given non-mob [persister].")
|
||||
stack_trace("Persist (P4P): Given non-mob [persister].")
|
||||
return
|
||||
|
||||
// Find out of this mob is a proper mob!
|
||||
@@ -74,7 +74,7 @@
|
||||
|
||||
/proc/persist_interround_data(var/mob/occupant, var/datum/spawnpoint/new_spawn_point_type)
|
||||
if(!istype(occupant))
|
||||
crash_with("Persist (PID): Given non-mob [occupant].")
|
||||
stack_trace("Persist (PID): Given non-mob [occupant].")
|
||||
return
|
||||
|
||||
var/datum/preferences/prefs = prep_for_persist(occupant)
|
||||
@@ -225,7 +225,7 @@
|
||||
*/
|
||||
/proc/persist_nif_data(var/mob/living/carbon/human/H,var/datum/preferences/prefs)
|
||||
if(!istype(H))
|
||||
crash_with("Persist (NIF): Given a nonhuman: [H]")
|
||||
stack_trace("Persist (NIF): Given a nonhuman: [H]")
|
||||
return
|
||||
|
||||
if(!prefs)
|
||||
|
||||
@@ -30,7 +30,7 @@ var/total_unit_tests = 0
|
||||
log_unit_test("Initializing Unit Testing")
|
||||
|
||||
if(!ticker)
|
||||
crash_with("No Ticker")
|
||||
stack_trace("No Ticker")
|
||||
world.Del()
|
||||
|
||||
var/said_msg = 0
|
||||
|
||||
@@ -339,7 +339,7 @@ var/list/all_maps = list()
|
||||
custom_skybox = new custom_skybox()
|
||||
|
||||
/datum/map_z_level/Destroy(var/force)
|
||||
crash_with("Attempt to delete a map_z_level instance [log_info_line(src)]")
|
||||
stack_trace("Attempt to delete a map_z_level instance [log_info_line(src)]")
|
||||
if(!force)
|
||||
return QDEL_HINT_LETMELIVE // No.
|
||||
if (using_map.zlevels["[z]"] == src)
|
||||
|
||||
@@ -112,11 +112,6 @@
|
||||
#include "code\__defines\dcs\flags.dm"
|
||||
#include "code\__defines\dcs\helpers.dm"
|
||||
#include "code\__defines\dcs\signals.dm"
|
||||
#include "code\_compatibility\509\_JSON.dm"
|
||||
#include "code\_compatibility\509\JSON Reader.dm"
|
||||
#include "code\_compatibility\509\JSON Writer.dm"
|
||||
#include "code\_compatibility\509\text.dm"
|
||||
#include "code\_compatibility\509\type2type.dm"
|
||||
#include "code\_global_vars\bitfields.dm"
|
||||
#include "code\_global_vars\misc.dm"
|
||||
#include "code\_global_vars\mobs.dm"
|
||||
|
||||
Reference in New Issue
Block a user