Skip to content

Commit

Permalink
tiny cleanup and speedups
Browse files Browse the repository at this point in the history
  • Loading branch information
ZeWaka authored and BatElite committed Aug 6, 2022
1 parent 77a41a0 commit 0f4af2f
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 16 deletions.
2 changes: 1 addition & 1 deletion _std/text.dm
Expand Up @@ -5,7 +5,7 @@
return ""

/proc/trim_right(text)
for (var/i = length(text), i > 0, i--)
for (var/i = length(text) to 1 step -1)
if (text2ascii(text, i) > 32)
return copytext(text, 1, i + 1)

Expand Down
2 changes: 1 addition & 1 deletion code/modules/mechanics/MechanicMadness.dm
Expand Up @@ -494,7 +494,7 @@
return

proc/componentSay(var/string)
string = trim(sanitize(html_encode(string)), 1)
string = trim(sanitize(html_encode(string)))
for(var/mob/O in all_hearers(7, src.loc))
O.show_message("<span class='game radio'><span class='name'>[src]</span><b> [bicon(src)] [pick("squawks", "beeps", "boops", "says", "screeches")], </b> <span class='message'>\"[string]\"</span></span>",2)

Expand Down
14 changes: 0 additions & 14 deletions code/procs/gamehelpers.dm
@@ -1,16 +1,3 @@

/*
replacetext(haystack, needle, replace)
Replaces all occurrences of needle in haystack (case-insensitive)
with replace value.
replaceText(haystack, needle, replace)
Replaces all occurrences of needle in haystack (case-sensitive)
with replace value.
*/

var/list/vowels_lower = list("a","e","i","o","u")
var/list/vowels_upper = list("A","E","I","O","U")
var/list/consonants_lower = list("b","c","d","f","g","h","j","k","l","m","n","p","q","r","s","t","v","w","x","y","z")
Expand Down Expand Up @@ -79,7 +66,6 @@ var/list/stinkThingies = list("ass","taint","armpit","excretions","leftovers","a
return null

/proc/get_area_name(N) //get area by it's name

for(var/area/A in world)
if(A.name == N)
return A
Expand Down

0 comments on commit 0f4af2f

Please sign in to comment.