Cleanup code and remove needtohack insanity code

This cleans up the code and properly integrates a few things, instead
of the absolutely tragic and insane code bypassing it, literally named
var/needtohack.
This commit is contained in:
Tigercat2000
2015-04-15 19:44:36 -07:00
parent a92e058b6c
commit b8f5fd5031
2 changed files with 13 additions and 19 deletions
+7 -12
View File
@@ -15,21 +15,16 @@
if(copytext(message,1,2) == "*")
return emote(copytext(message,2))
var/needtohack = 1 //hacky way to get around stupid byond shit
var/datum/language/speaking = parse_language(message)
if(speaking == null)
var/quickcheck = get_default_language()
if(quickcheck == null)
speaking = all_languages["Xenomorph"] //this is the hackiest thing, no clue how to avoid it
needtohack = 0
else
speaking = get_default_language()
needtohack = 0
if(speaking)
if(needtohack)
message = copytext(message,2+length(speaking.key))
message = copytext(message,2+length(speaking.key))
else
var/quickcheck = get_default_language()
if(quickcheck)
speaking = get_default_language()
else //because no clue how to actually set xeno's default language since they aren't a species, just do it here
speaking = all_languages["Xenomorph"]
var/ending = copytext(message, length(message))
if (speaking)
+6 -7
View File
@@ -69,18 +69,17 @@
message = trim(copytext(message,3))
//parse language key and consume it
var/needtohack = 1 //hacky way to get around stupid byond shit
var/datum/language/speaking = parse_language(message)
if (speaking)
if(speaking == null)
message = trim(copytext(message,2+length(speaking.key)))
else
speaking = get_default_language()
needtohack = 0
if (speaking && !(speaking == null))
if (speaking)
verb = speaking.speech_verb
if(needtohack)
message = trim(copytext(message,2+length(speaking.key)))
// This is broadcast to all mobs with the language,
// irrespective of distance or anything else.
if(speaking.flags & HIVEMIND)
speaking.broadcast(src,trim(message))
return 1