Langserver fixes, vol 2 (#7401)

This commit is contained in:
Erki
2019-11-15 23:42:25 +02:00
committed by Werner
parent 444c0d5ea5
commit ff41b92e97
39 changed files with 100 additions and 159 deletions
+7 -7
View File
@@ -369,7 +369,7 @@ proc/admin_notice(var/message, var/rights)
if(FC.is_admin_channel)
dat+="<B><FONT style='BACKGROUND-COLOR: LightGreen'><A href='?src=\ref[src];ac_show_channel=\ref[FC]'>[FC.channel_name]</A></FONT></B><BR>"
else
dat+="<B><A href='?src=\ref[src];ac_show_channel=\ref[FC]'>[FC.channel_name]</A> [(FC.censored) ? ("<FONT COLOR='red'>***</FONT>") : ()]<BR></B>"
dat+="<B><A href='?src=\ref[src];ac_show_channel=\ref[FC]'>[FC.channel_name]</A> [(FC.censored) ? ("<FONT COLOR='red'>***</FONT>") : null]<BR></B>"
dat+={"<BR><HR><A href='?src=\ref[src];ac_refresh=1'>Refresh</A>
<BR><A href='?src=\ref[src];ac_setScreen=[0]'>Back</A>
"}
@@ -456,7 +456,7 @@ proc/admin_notice(var/message, var/rights)
else
for(var/channel in SSnews.network_channels)
var/datum/feed_channel/FC = SSnews.GetFeedChannel(channel)
dat+="<A href='?src=\ref[src];ac_pick_censor_channel=\ref[FC]'>[FC.channel_name]</A> [(FC.censored) ? ("<FONT COLOR='red'>***</FONT>") : ()]<BR>"
dat+="<A href='?src=\ref[src];ac_pick_censor_channel=\ref[FC]'>[FC.channel_name]</A> [(FC.censored) ? ("<FONT COLOR='red'>***</FONT>") : null]<BR>"
dat+="<BR><A href='?src=\ref[src];ac_setScreen=[0]'>Cancel</A>"
if(11)
dat+={"
@@ -470,7 +470,7 @@ proc/admin_notice(var/message, var/rights)
else
for(var/channel in SSnews.network_channels)
var/datum/feed_channel/FC = SSnews.GetFeedChannel(channel)
dat+="<A href='?src=\ref[src];ac_pick_d_notice=\ref[FC]'>[FC.channel_name]</A> [(FC.censored) ? ("<FONT COLOR='red'>***</FONT>") : ()]<BR>"
dat+="<A href='?src=\ref[src];ac_pick_d_notice=\ref[FC]'>[FC.channel_name]</A> [(FC.censored) ? ("<FONT COLOR='red'>***</FONT>") : null]<BR>"
dat+="<BR><A href='?src=\ref[src];ac_setScreen=[0]'>Back</A>"
if(12)
@@ -1126,7 +1126,7 @@ proc/admin_notice(var/message, var/rights)
out += "<b>Autotraitor <a href='?src=\ref[SSticker.mode];toggle=autotraitor'>disabled</a></b>.<br/>"
out += "<b>All antag ids:</b>"
if(LAZYLEN(SSticker.mode.antag_templates)).
if(LAZYLEN(SSticker.mode.antag_templates))
for(var/datum/antagonist/antag in SSticker.mode.antag_templates)
antag.update_current_antag_max()
out += " <a href='?src=\ref[SSticker.mode];debug_antag=[antag.id]'>[antag.id]</a>"
@@ -1374,8 +1374,8 @@ proc/admin_notice(var/message, var/rights)
return
if(!check_rights(R_SERVER,0))
message = sanitize(message, 500, extra = 0)
var/list/sounds = file2list("sound/serversound_list.txt");
sounds += "--CANCEL--"
sounds += "--LOCAL--"
@@ -1389,7 +1389,7 @@ proc/admin_notice(var/message, var/rights)
melody = input("Select a sound to play", "Sound select") as sound
if(!melody)
return
command_announcement.Announce(message, title, new_sound = melody)
log_and_message_admins("made custom announcement with custom sound", usr)
feedback_add_details("admin_verb","ACS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
+1 -5
View File
@@ -27,11 +27,7 @@ var/datum/admin_secrets/admin_secrets = new()
/datum/admin_secret_category
var/name = ""
var/desc = ""
var/list/datum/admin_secret_item/items
/datum/admin_secret_category
..()
items = list()
var/list/datum/admin_secret_item/items = list()
/datum/admin_secret_category/proc/can_view(var/mob/user)
for(var/datum/admin_secret_item/item in items)
+1 -1
View File
@@ -403,7 +403,7 @@
if (!check_rights(R_MOD|R_ADMIN))
return
var/ckey = ckey(input("Please specify the ckey you want to search for:", "ckey")) as text
var/ckey = ckey(input("Please specify the ckey you want to search for:", "ckey") as text)
if (!ckey)
to_chat(usr, "<span class='notice'>Cancelled.</span>")
return
@@ -13,7 +13,7 @@
switch(mission_level)
if(REPRESENTATIVE_MISSION_HIGH)
rep_objectives = pick("Collect evidence of Nanotrasen being unfair or bigoted to Vaurca employees, to be used as leverage in future hive labor negotiations",
"Begin the TCFL enlistment process for an individual, completing an Enlistment form to be turned in by the individual,"
"Begin the TCFL enlistment process for an individual, completing an Enlistment form to be turned in by the individual",
"Develop a metric to grade the performance of different Vaurca broods that share a job")
if(REPRESENTATIVE_MISSION_MEDIUM)
+1 -24
View File
@@ -1,27 +1,4 @@
/*
/datum/bounty/item/alien_organs
name = "Alien Organs"
description = "Nanotrasen is interested in studying Xenomorph biology. Ship a set of organs to be thoroughly compensated."
reward = 25000
required_count = 3
wanted_types = list(/obj/item/organ/brain/alien, /obj/item/organ/alien, /obj/item/organ/body_egg/alien_embryo)
/datum/bounty/item/syndicate_documents
name = "Syndicate Documents"
description = "Intel regarding the syndicate is highly prized at CentCom. If you find syndicate documents, ship them. You could save lives."
reward = 10000
wanted_types = list(/obj/item/documents/syndicate, /obj/item/documents/photocopy)
/datum/bounty/item/syndicate_documents/applies_to(obj/O)
if(!..())
return FALSE
if(istype(O, /obj/item/documents/photocopy))
var/obj/item/documents/photocopy/Copy = O
return (Copy.copy_type && ispath(Copy.copy_type, /obj/item/documents/syndicate))
return TRUE
*/
/datum/bounty/more_bounties/
..()
/datum/bounty/more_bounties
name = "More Bounties"
description = "Complete enough bounties and %BOSSSHORT will issue new ones!"
reward = 3 // number of bounties
+2 -2
View File
@@ -136,7 +136,7 @@ var/list/global/random_stock_large = list()
var/cratespawn = 0
var/obj/structure/closet/crate/emptiest
if (prob(70))//We'll usually put items in crates
var/minweight = 99999999999//We will distribute items somewhat evenly among crates
var/minweight = 1000000000 //We will distribute items somewhat evenly among crates
//by selecting the least-filled one for each spawn
for (var/obj/structure/closet/crate/C in containers)
@@ -247,4 +247,4 @@ var/list/global/random_stock_large = list()
name = "Large Stock Marker"
desc = "This marks a place where a large object could spawn in cargo"
icon = 'icons/mob/screen/generic.dmi'
icon_state = "x3"
icon_state = "x3"
@@ -32,7 +32,7 @@
rig.malfunction_delay = 0
else
rig.malfunctioning += 10
rig.malfunction_delay = 99999999999999999999
rig.malfunction_delay = 10000000000
/datum/wires/rig/UpdatePulsed(var/index)
@@ -61,4 +61,4 @@
var/obj/item/weapon/rig/rig = holder
if(rig.open)
return 1
return 0
return 0
+2 -3
View File
@@ -85,9 +85,8 @@ proc/Ellipsis(original_msg, chance = 50)
if(chance <= 0) return "..."
if(chance >= 100) return original_msg
var/list
words = text2list(original_msg," ")
new_words = list()
var/list/words = text2list(original_msg," ")
var/list/new_words = list()
var/new_msg = ""
+2 -2
View File
@@ -182,7 +182,7 @@
//We will not touch things which are not required for this recipe. They will be left behind for the caller
//to decide what to do. They may be used again to make another recipe or discarded, or merged into the results,
//thats no longer the concern of this proc
var/datum/reagents/buffer = new /datum/reagents(999999999999, null)//
var/datum/reagents/buffer = new /datum/reagents(1000000000000, null)//
//Find items we need
@@ -228,7 +228,7 @@
If, as in the most common case, there is only a single result, then it will just be a reference to
the single-result's reagents
*/
var/datum/reagents/holder = new/datum/reagents(9999999999)
var/datum/reagents/holder = new/datum/reagents(10000000000)
var/list/results = list()
while (tally < result_quantity)
var/obj/result_obj = new result(container)
+1 -1
View File
@@ -372,7 +372,7 @@
return
// Check if we should even bother working on the current seed datum.
if(seed.mutants. && seed.mutants.len && severity > 1)
if(seed.mutants?.len && severity > 1)
mutate_species()
return
-2
View File
@@ -459,7 +459,5 @@
UNSETEMPTY(effect_str)
UNSETEMPTY(affecting_turfs)
#undef QUEUE_UPDATE
#undef DO_UPDATE
#undef INTELLIGENT_UPDATE
#undef PSEUDO_WEDGE
+4 -7
View File
@@ -73,7 +73,7 @@ var/list/diona_banned_languages = list(
apply_radiation(-2)
DS.stored_energy += 2
apply_radiation(-0.5) //Radiation is gradually wasted if its not used for something
if(total_radiation < 0)
total_radiation = null
@@ -90,7 +90,7 @@ var/list/diona_banned_languages = list(
if (DS.nutrient_organ)
if (DS.nutrient_organ.is_broken())
return 0
if (consume_nutrition_from_air && (nutrition / max_nutrition > 0.25))
to_chat(src, span("notice", "You feel like you have replanished enough of nutrition to stay alive. Consuming more makes you feel gross."))
consume_nutrition_from_air = !consume_nutrition_from_air
@@ -324,13 +324,13 @@ var/list/diona_banned_languages = list(
return
DS.regen_limb_progress = 0
diona_regen_progress(DS)
visible_message("<span class='warning'>[src] begins to shift and quiver.</span>",
"<span class='warning'>You begin to shift and quiver, feeling a stirring within your trunk</span>")
DS.regening_organ = TRUE
to_chat(src, "<span class='notice'>You are trying to regrow a lost limb, this is a long and complicated process!</span>")
var/list/special_case = list(
/obj/item/organ/external/arm/diona = /obj/item/organ/external/hand/diona,
/obj/item/organ/external/arm/right/diona = /obj/item/organ/external/hand/right/diona,
@@ -660,9 +660,6 @@ var/list/diona_banned_languages = list(
nutrient_organ = null
return ..()
#undef FLASHLIGHT_STRENGTH
#undef PDALIGHT_STRENGTH
#undef DIONA_MAX_LIGHT
#undef TEMP_REGEN_STOP
#undef TEMP_REGEN_NORMAL
#undef TEMP_INCREASE_REGEN_DOUBLE
+1 -1
View File
@@ -41,7 +41,7 @@ calculate text size per text.
tastes[taste_desc] += taste_amount
else
tastes[taste_desc] = taste_amount
if(!(R.default_temperature in (T0C + 15 to T0C + 25)))
if(R.default_temperature >= (T0C + 15) && R.default_temperature <= (T0C + 25))
lukewarm = 1
//deal with percentages
+2 -2
View File
@@ -65,7 +65,7 @@
/mob/living/bullet_act(var/obj/item/projectile/P, var/def_zone)
//Being hit while using a cloaking device
var/obj/item/weapon/cloaking_device/C = locate((/obj/item/weapon/cloaking_device) in src)
var/obj/item/weapon/cloaking_device/C = locate(/obj/item/weapon/cloaking_device) in src
if(C && C.active)
C.attack_self(src)//Should shut it off
update_icons()
@@ -401,4 +401,4 @@
client.screen += hud_used.hide_actions_toggle
#undef MOB_FIRE_LIGHT_RANGE //These control the intensity and range of light given off by a mob which is on fire
#undef MOB_FIRE_LIGHT_POWER
#undef MOB_FIRE_LIGHT_POWER
+1 -1
View File
@@ -303,7 +303,7 @@
/obj/item/pipe/can_fall(turf/below, turf/simulated/open/dest = src.loc)
. = ..()
if((locate(/obj/structure/disposalpipe/up) in below) || locate(/obj/machinery/atmospherics/pipe/zpipe/up in below))
if((locate(/obj/structure/disposalpipe/up) in below) || (locate(/obj/machinery/atmospherics/pipe/zpipe/up) in below))
return FALSE
// Only things that stop mechas are atoms that, well, stop them.
-1
View File
@@ -71,7 +71,6 @@
*/
/turf/simulated/open/proc/add_climber(atom/climber, flags = CLIMBER_DEFAULT)
if (!flags)
PROCLOG_WEIRD("Attempted to add climber [climber] without flags.")
return FALSE
if (LAZYACCESS(climbers, climber))
+2 -1
View File
@@ -493,7 +493,8 @@
stamps += (stamps=="" ? "<HR>" : "<BR>") + "<i>This paper has been stamped with the [P.name].</i>"
var/image/stampoverlay = image('icons/obj/bureaucracy.dmi')
var/{x; y;}
var/x
var/y
if(istype(P, /obj/item/weapon/stamp/captain) || istype(P, /obj/item/weapon/stamp/centcomm))
x = rand(-2, 0)
y = rand(-1, 2)
+2 -2
View File
@@ -12,7 +12,7 @@
attack_verb = list("bapped")
var/page = 1 // current page
var/list/pages = list() // Ordered list of pages as they are to be displayed. Can be different order than src.contents.
var amount = 0 // How many sheet
var/amount = 0 // How many sheet
drop_sound = 'sound/items/drop/paper.ogg'
/obj/item/weapon/paper_bundle/attackby(obj/item/weapon/W as obj, mob/user as mob)
@@ -126,7 +126,7 @@
else if(istype(pages[page], /obj/item/weapon/photo))
var/obj/item/weapon/photo/P = W
to_chat(user, browse_rsc(P.img, "tmp_photo.png"))
user << browse(dat + "<html><head><title>[P.name]</title></head>" + "<body style='overflow:hidden'>" + "<div> <img src='tmp_photo.png' width = '180'" + "[P.scribble ? "<div> Written on the back:<br><i>[P.scribble]</i>" : ]" + "</body></html>", "window=[name]")
user << browse(dat + "<html><head><title>[P.name]</title></head>" + "<body style='overflow:hidden'>" + "<div> <img src='tmp_photo.png' width = '180'" + "[P.scribble ? "<div> Written on the back:<br><i>[P.scribble]</i>" : null]" + "</body></html>", "window=[name]")
/obj/item/weapon/paper_bundle/attack_self(mob/user as mob)
src.show_content(user)
+2 -1
View File
@@ -459,7 +459,8 @@
/obj/item/projectile/proc/process_hitscan()
var/safety = range * 3
record_hitscan_start(RETURN_POINT_VECTOR_INCREMENT(src, Angle, MUZZLE_EFFECT_PIXEL_INCREMENT, 1))
var/return_vector = RETURN_POINT_VECTOR_INCREMENT(src, Angle, MUZZLE_EFFECT_PIXEL_INCREMENT, 1)
record_hitscan_start(return_vector)
while(loc && !QDELETED(src))
if(paused)
stoplag(1)
@@ -2254,7 +2254,7 @@
/obj/item/weapon/reagent_containers/food/snacks/jelliedtoast/cherry
/obj/item/weapon/reagent_containers/food/snacks/jelliedtoast/cherry/Initialize()
. ..()
. = ..()
reagents.add_reagent("cherryjelly", 5)
/obj/item/weapon/reagent_containers/food/snacks/jelliedtoast/slime
-1
View File
@@ -76,7 +76,6 @@
return
if (!loc)
PROCLOG_WEIRD("loc is null, breaking self.")
stat |= BROKEN
return
+1 -1
View File
@@ -407,7 +407,7 @@ won't update every console in existence) but it's more of a hassle to do. Also,
var/obj/item/weapon/paper/PR = new/obj/item/weapon/paper
var/pname = "list of researched technologies"
var/info = "<center><b>[station_name()] Science Laboratories</b>"
info += "<h2>[ (text2num(href_list["print"]) == 2) ? "Detailed" : ] Research Progress Report</h2>"
info += "<h2>[ (text2num(href_list["print"]) == 2) ? "Detailed" : null] Research Progress Report</h2>"
info += "<i>report prepared at [worldtime2text()] station time</i></center><br>"
if(text2num(href_list["print"]) == 2)
info += GetResearchListInfo()
+8 -10
View File
@@ -53,10 +53,9 @@
if(/token/word)
return new/node/expression/value/variable(T.value)
if(/token/accessor)
var
token/accessor/A=T
node/expression/value/variable/E//=new(A.member)
stack/S=new()
var/token/accessor/A = T
var/node/expression/value/variable/E
var/stack/S = new()
while(istype(A.object, /token/accessor))
S.Push(A)
A=A.object
@@ -181,11 +180,10 @@
- <ParseParamExpression()>
*/
ParseExpression(list/end=list(/token/end), list/ErrChars=list("{", "}"))
var/stack
opr=new
val=new
var/stack/opr = new
var/stack/val = new
src.expecting=VALUE
for()
while (1)
if(EndOfExpression(end))
break
if(istype(curToken, /token/symbol) && ErrChars.Find(curToken.value))
@@ -278,7 +276,7 @@
NextToken() //skip open parenthesis, already found
var/loops = 0
for()
while (1)
loops++
if(loops>=1000)
CRASH("Something TERRIBLE has gone wrong in ParseFunctionExpression ;__;")
@@ -311,4 +309,4 @@
- <ParseExpression()>
*/
ParseParamExpression()
return ParseExpression(list(",", ")"))
return ParseExpression(list(",", ")"))
+1 -1
View File
@@ -134,7 +134,7 @@ var/const/Represents a special statement in the code triggered by a keyword.
parser.NextToken()
if(!parser.CheckToken("(", /token/symbol))
return KW_FAIL
for() //for now parameters can be separated by whitespace - they don't need a comma in between
while (1) //for now parameters can be separated by whitespace - they don't need a comma in between
if(istype(parser.curToken, /token/symbol))
switch(parser.curToken.value)
if(",")
+2 -2
View File
@@ -172,7 +172,7 @@
if(!CheckToken("(", /token/symbol)) //Check for and skip open parenthesis
return
var/loops = 0
for()
while (1)
loops++
if(loops>=6000)
CRASH("Something TERRIBLE has gone wrong in ParseFunctionStatement ;__;")
@@ -186,4 +186,4 @@
return
var/node/expression/P=ParseParamExpression()
stmt.parameters+=P
if(istype(curToken, /token/symbol) && curToken.value==",") NextToken()
if(istype(curToken, /token/symbol) && curToken.value==",") NextToken()
+13 -18
View File
@@ -153,8 +153,7 @@
start - The character used to start the string.
*/
ReadString(start)
var
buf
var/buf
for(, codepos <= lentext(code), codepos++)//codepos to lentext(code))
var/char=copytext(code, codepos, codepos+1)
switch(char)
@@ -189,9 +188,8 @@
Reads characters separated by an item in <delim> into a token.
*/
ReadWord()
var
char=copytext(code, codepos, codepos+1)
buf
var/char=copytext(code, codepos, codepos+1)
var/buf
while(!delim.Find(char) && codepos<=lentext(code))
buf+=char
char=copytext(code, ++codepos, codepos+1)
@@ -206,9 +204,8 @@
Reads a symbol into a token.
*/
ReadSymbol()
var
char=copytext(code, codepos, codepos+1)
buf
var/char=copytext(code, codepos, codepos+1)
var/buf
while(options.symbols.Find(buf+char))
buf+=char
@@ -223,10 +220,9 @@
Reads a number into a token.
*/
ReadNumber()
var
char=copytext(code, codepos, codepos+1)
buf
dec=0
var/char = copytext(code, codepos, codepos+1)
var/buf
var/dec = 0
while(options.IsDigit(char) || (char=="." && !dec))
if(char==".") dec=1
@@ -246,14 +242,13 @@
*/
ReadComment()
var
char=copytext(code, codepos, codepos+1)
nextchar=copytext(code, codepos+1, codepos+2)
charstring = char+nextchar
comm = 1
var/char = copytext(code, codepos, codepos+1)
var/nextchar = copytext(code, codepos+1, codepos+2)
var/charstring = char+nextchar
var/comm = 1
// 1: single-line comment
// 2: multi-line comment
expectedend = 0
var/expectedend = 0
if(charstring == "//" || charstring == "/*")
if(charstring == "/*")