Fixes runtimes & some cleanup (#48776)

* Keyless emote sanity.

* Camera bug runtime

* SM runtime

* Removes random <br>'s in atmos logs

* light spark runtime

* uranium splashing on walls runtime

* throwing clown with clown shoes runtime.

* beam rifle runtime

* Don't warn on mesageless keyless emotes.

* Fixup
This commit is contained in:
AnturK
2020-01-24 13:23:59 -05:00
committed by Emmett Gaines
parent 87ebdc8001
commit b04934a0d1
11 changed files with 34 additions and 25 deletions
+13 -9
View File
@@ -64,12 +64,16 @@ GLOBAL_LIST_EMPTY(emote_list)
. = list()
for(var/path in subtypesof(/datum/emote))
var/datum/emote/E = new path()
if(!.[E.key])
.[E.key] = list(E)
else
.[E.key] += E
if(!.[E.key_third_person])
.[E.key_third_person] = list(E)
else
.[E.key_third_person] |= E
if(E.key)
if(!.[E.key])
.[E.key] = list(E)
else
.[E.key] += E
else if(E.message) //Assuming all non-base emotes have this
stack_trace("Keyless emote: [E.type]")
if(E.key_third_person) //This one is optional
if(!.[E.key_third_person])
.[E.key_third_person] = list(E)
else
.[E.key_third_person] |= E
@@ -39,7 +39,7 @@
get_cameras()
for(var/cam_tag in bugged_cameras)
var/obj/machinery/camera/camera = bugged_cameras[cam_tag]
if(camera.bug == src)
if(camera && camera.bug == src)
camera.bug = null
bugged_cameras = list()
if(tracking)
@@ -95,6 +95,8 @@
html = "<h3>Select a camera:</h3> <a href='?src=[REF(src)];view'>\[Cancel camera view\]</a><hr><table>"
for(var/entry in cameras)
var/obj/machinery/camera/C = cameras[entry]
if(QDELETED(C))
continue
var/functions = ""
if(C.bug == src)
functions = " - <a href='?src=[REF(src)];monitor=[REF(C)]'>\[Monitor\]</a> <a href='?src=[REF(src)];emp=[REF(C)]'>\[Disable\]</a>"
@@ -303,9 +303,9 @@
if(close_valve)
valve_open = FALSE
update_icon()
investigate_log("Valve was <b>closed</b> by [key_name(user)].<br>", INVESTIGATE_ATMOS)
investigate_log("Valve was <b>closed</b> by [key_name(user)].", INVESTIGATE_ATMOS)
else if(valve_open && holding)
investigate_log("[key_name(user)] started a transfer into [holding].<br>", INVESTIGATE_ATMOS)
investigate_log("[key_name(user)] started a transfer into [holding].", INVESTIGATE_ATMOS)
/obj/machinery/portable_atmospherics/canister/process_atmos()
..()
@@ -124,13 +124,13 @@
if(!user.transferItemToLoc(T, src))
return
to_chat(user, "<span class='notice'>[holding ? "In one smooth motion you pop [holding] out of [src]'s connector and replace it with [T]" : "You insert [T] into [src]"].</span>")
investigate_log("had its internal [holding] swapped with [T] by [key_name(user)].<br>", INVESTIGATE_ATMOS)
investigate_log("had its internal [holding] swapped with [T] by [key_name(user)].", INVESTIGATE_ATMOS)
replace_tank(user, FALSE, T)
update_icon()
else if(W.tool_behaviour == TOOL_WRENCH)
if(!(machine_stat & BROKEN))
if(connected_port)
investigate_log("was disconnected from [connected_port] by [key_name(user)].<br>", INVESTIGATE_ATMOS)
investigate_log("was disconnected from [connected_port] by [key_name(user)].", INVESTIGATE_ATMOS)
disconnect()
W.play_tool_sound(src)
user.visible_message( \
@@ -153,7 +153,7 @@
"<span class='notice'>You fasten [src] to the port.</span>", \
"<span class='hear'>You hear a ratchet.</span>")
update_icon()
investigate_log("was connected to [possible_port] by [key_name(user)].<br>", INVESTIGATE_ATMOS)
investigate_log("was connected to [possible_port] by [key_name(user)].", INVESTIGATE_ATMOS)
else
return ..()
@@ -80,7 +80,7 @@
on = FALSE
update_icon()
else if(on && holding && direction == PUMP_OUT)
investigate_log("[key_name(user)] started a transfer into [holding].<br>", INVESTIGATE_ATMOS)
investigate_log("[key_name(user)] started a transfer into [holding].", INVESTIGATE_ATMOS)
/obj/machinery/portable_atmospherics/pump/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
@@ -122,14 +122,14 @@
message_admins("[ADMIN_LOOKUPFLW(usr)] turned on a pump that contains [n2o ? "N2O" : ""][n2o && plasma ? " & " : ""][plasma ? "Plasma" : ""] at [ADMIN_VERBOSEJMP(src)]")
log_admin("[key_name(usr)] turned on a pump that contains [n2o ? "N2O" : ""][n2o && plasma ? " & " : ""][plasma ? "Plasma" : ""] at [AREACOORD(src)]")
else if(on && direction == PUMP_OUT)
investigate_log("[key_name(usr)] started a transfer into [holding].<br>", INVESTIGATE_ATMOS)
investigate_log("[key_name(usr)] started a transfer into [holding].", INVESTIGATE_ATMOS)
. = TRUE
if("direction")
if(direction == PUMP_OUT)
direction = PUMP_IN
else
if(on && holding)
investigate_log("[key_name(usr)] started a transfer into [holding].<br>", INVESTIGATE_ATMOS)
investigate_log("[key_name(usr)] started a transfer into [holding].", INVESTIGATE_ATMOS)
direction = PUMP_OUT
. = TRUE
if("pressure")
@@ -109,7 +109,7 @@
on = FALSE
update_icon()
else if(on && holding)
investigate_log("[key_name(user)] started a transfer into [holding].<br>", INVESTIGATE_ATMOS)
investigate_log("[key_name(user)] started a transfer into [holding].", INVESTIGATE_ATMOS)
/obj/machinery/portable_atmospherics/scrubber/ui_act(action, params)
if(..())
+3 -2
View File
@@ -21,8 +21,9 @@
/obj/item/clothing/shoes/clown_shoes/banana_shoes/step_action()
. = ..()
var/mob/wearer = loc
var/datum/component/material_container/bananium = GetComponent(/datum/component/material_container)
if(on)
if(on && istype(wearer))
if(bananium.get_material_amount(/datum/material/bananium) < 100)
on = !on
if(!always_noslip)
@@ -30,7 +31,7 @@
update_icon()
to_chat(loc, "<span class='warning'>You ran out of bananium!</span>")
else
new /obj/item/grown/bananapeel/specialpeel(get_step(src,turn(usr.dir, 180))) //honk
new /obj/item/grown/bananapeel/specialpeel(get_step(src,turn(wearer.dir, 180))) //honk
bananium.use_amount_mat(100, /datum/material/bananium)
/obj/item/clothing/shoes/clown_shoes/banana_shoes/attack_self(mob/user)
+1 -1
View File
@@ -396,7 +396,7 @@
update()
/obj/machinery/light/proc/broken_sparks(start_only=FALSE)
if(status == LIGHT_BROKEN && has_power())
if(!QDELETED(src) && status == LIGHT_BROKEN && has_power())
if(!start_only)
do_sparks(3, TRUE, src)
var/delay = rand(BROKEN_SPARKS_MIN, BROKEN_SPARKS_MAX)
@@ -930,7 +930,7 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
//Then we finish it all up
//This gotdamn variable is a boomer and keeps giving me problems
var/turf/T = get_turf(target)
var/pressure = T.return_air().return_pressure()
var/pressure = max(1,T.return_air().return_pressure())
//We get our range with the strength of the zap and the pressure, the lower the former and the higher the latter the better
var/new_range = CLAMP(zap_str / pressure * 10, 2, 7)
if(prob(5))
@@ -180,7 +180,8 @@
/obj/item/gun/energy/beam_rifle/proc/aiming_beam(force_update = FALSE)
var/diff = abs(aiming_lastangle - lastangle)
check_user()
if(!check_user())
return
if(diff < AIMING_BEAM_ANGLE_CHANGE_THRESHOLD && !force_update)
return
aiming_lastangle = lastangle
@@ -897,7 +897,8 @@
var/obj/effect/decal/cleanable/greenglow/GG = locate() in T.contents
if(!GG)
GG = new/obj/effect/decal/cleanable/greenglow(T)
GG.reagents.add_reagent(type, reac_volume)
if(!QDELETED(GG))
GG.reagents.add_reagent(type, reac_volume)
/datum/reagent/uranium/radium
name = "Radium"