mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-13 03:02:38 +00:00
Some Processing improvements (#80693)
## About The Pull Request Got the idea from #80682. A lot of parent procs don't do anything, some are just formatted in a bad way, and others early return and do no ops, it's bad in general but this should give us a head start. Some good overhead saved here
This commit is contained in:
@@ -877,9 +877,6 @@ or shoot a gun to move around via Newton's 3rd Law of Motion."
|
|||||||
time_left_overlay.maptext = MAPTEXT("<span style='color: [(timeleft <= 10 SECONDS) ? "red" : "white"]'><b>[CEILING(timeleft / (1 SECONDS), 1)]</b></span>")
|
time_left_overlay.maptext = MAPTEXT("<span style='color: [(timeleft <= 10 SECONDS) ? "red" : "white"]'><b>[CEILING(timeleft / (1 SECONDS), 1)]</b></span>")
|
||||||
time_left_overlay.transform = time_left_overlay.transform.Translate(4, 19)
|
time_left_overlay.transform = time_left_overlay.transform.Translate(4, 19)
|
||||||
add_overlay(time_left_overlay)
|
add_overlay(time_left_overlay)
|
||||||
if(isnull(poll))
|
|
||||||
return
|
|
||||||
..()
|
|
||||||
|
|
||||||
/atom/movable/screen/alert/poll_alert/Click(location, control, params)
|
/atom/movable/screen/alert/poll_alert/Click(location, control, params)
|
||||||
. = ..()
|
. = ..()
|
||||||
|
|||||||
@@ -35,7 +35,6 @@
|
|||||||
for(var/obj/projectile/projectile in tracked)
|
for(var/obj/projectile/projectile in tracked)
|
||||||
if(!(projectile in ranged) || !projectile.loc)
|
if(!(projectile in ranged) || !projectile.loc)
|
||||||
release_projectile(projectile)
|
release_projectile(projectile)
|
||||||
..()
|
|
||||||
|
|
||||||
/datum/proximity_monitor/advanced/projectile_dampener/setup_edge_turf(turf/target)
|
/datum/proximity_monitor/advanced/projectile_dampener/setup_edge_turf(turf/target)
|
||||||
. = ..()
|
. = ..()
|
||||||
|
|||||||
@@ -8,8 +8,7 @@
|
|||||||
/obj/machinery/camera/process()
|
/obj/machinery/camera/process()
|
||||||
// motion camera event loop
|
// motion camera event loop
|
||||||
if(!isMotion())
|
if(!isMotion())
|
||||||
. = PROCESS_KILL
|
return PROCESS_KILL
|
||||||
return
|
|
||||||
if(machine_stat & EMPED)
|
if(machine_stat & EMPED)
|
||||||
return
|
return
|
||||||
if (detectTime > 0)
|
if (detectTime > 0)
|
||||||
|
|||||||
@@ -2025,7 +2025,6 @@
|
|||||||
if(prob(50))
|
if(prob(50))
|
||||||
radiate()
|
radiate()
|
||||||
last_event = world.time
|
last_event = world.time
|
||||||
..()
|
|
||||||
|
|
||||||
/obj/machinery/door/airlock/uranium/proc/radiate()
|
/obj/machinery/door/airlock/uranium/proc/radiate()
|
||||||
radiation_pulse(
|
radiation_pulse(
|
||||||
|
|||||||
@@ -152,7 +152,6 @@
|
|||||||
. += span_warning("[recharging_text]")
|
. += span_warning("[recharging_text]")
|
||||||
|
|
||||||
/obj/machinery/drone_dispenser/process()
|
/obj/machinery/drone_dispenser/process()
|
||||||
..()
|
|
||||||
if((machine_stat & (NOPOWER|BROKEN)) || !anchored)
|
if((machine_stat & (NOPOWER|BROKEN)) || !anchored)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
@@ -178,7 +178,6 @@
|
|||||||
. += span_notice("Alt-click [src] to [state_open ? "close" : "open"] it.")
|
. += span_notice("Alt-click [src] to [state_open ? "close" : "open"] it.")
|
||||||
|
|
||||||
/obj/machinery/sleeper/process()
|
/obj/machinery/sleeper/process()
|
||||||
..()
|
|
||||||
use_power(idle_power_usage)
|
use_power(idle_power_usage)
|
||||||
|
|
||||||
/obj/machinery/sleeper/nap_violation(mob/violator)
|
/obj/machinery/sleeper/nap_violation(mob/violator)
|
||||||
|
|||||||
@@ -35,8 +35,7 @@
|
|||||||
|
|
||||||
/obj/item/t_scanner/process()
|
/obj/item/t_scanner/process()
|
||||||
if(!on)
|
if(!on)
|
||||||
STOP_PROCESSING(SSobj, src)
|
return PROCESS_KILL
|
||||||
return null
|
|
||||||
scan()
|
scan()
|
||||||
|
|
||||||
/obj/item/t_scanner/proc/scan()
|
/obj/item/t_scanner/proc/scan()
|
||||||
|
|||||||
@@ -172,7 +172,7 @@
|
|||||||
set_light_color(pick(COLOR_SOFT_RED, LIGHT_COLOR_GREEN, LIGHT_COLOR_LIGHT_CYAN, LIGHT_COLOR_LAVENDER))
|
set_light_color(pick(COLOR_SOFT_RED, LIGHT_COLOR_GREEN, LIGHT_COLOR_LIGHT_CYAN, LIGHT_COLOR_LAVENDER))
|
||||||
open_flame()
|
open_flame()
|
||||||
else
|
else
|
||||||
STOP_PROCESSING(SSobj, src)
|
return PROCESS_KILL
|
||||||
|
|
||||||
/obj/item/dualsaber/IsReflect()
|
/obj/item/dualsaber/IsReflect()
|
||||||
if(HAS_TRAIT(src, TRAIT_WIELDED) && prob(block_chance))
|
if(HAS_TRAIT(src, TRAIT_WIELDED) && prob(block_chance))
|
||||||
|
|||||||
@@ -52,8 +52,7 @@
|
|||||||
|
|
||||||
/obj/item/flamethrower/process()
|
/obj/item/flamethrower/process()
|
||||||
if(!lit || !igniter)
|
if(!lit || !igniter)
|
||||||
STOP_PROCESSING(SSobj, src)
|
return PROCESS_KILL
|
||||||
return null
|
|
||||||
var/turf/location = loc
|
var/turf/location = loc
|
||||||
if(ismob(location))
|
if(ismob(location))
|
||||||
var/mob/M = location
|
var/mob/M = location
|
||||||
|
|||||||
@@ -232,7 +232,6 @@
|
|||||||
metabolization_amount = REAGENTS_METABOLISM
|
metabolization_amount = REAGENTS_METABOLISM
|
||||||
|
|
||||||
/obj/item/food/bubblegum/bubblegum/process()
|
/obj/item/food/bubblegum/bubblegum/process()
|
||||||
. = ..()
|
|
||||||
if(iscarbon(loc))
|
if(iscarbon(loc))
|
||||||
hallucinate(loc)
|
hallucinate(loc)
|
||||||
|
|
||||||
|
|||||||
@@ -18,18 +18,17 @@
|
|||||||
update_appearance()
|
update_appearance()
|
||||||
|
|
||||||
/obj/machinery/shuttle_scrambler/process()
|
/obj/machinery/shuttle_scrambler/process()
|
||||||
if(active)
|
if(!active)
|
||||||
if(is_station_level(z))
|
return PROCESS_KILL
|
||||||
var/datum/bank_account/account = SSeconomy.get_dep_account(ACCOUNT_CAR)
|
|
||||||
if(account)
|
if(!is_station_level(z))
|
||||||
var/siphoned = min(account.account_balance,siphon_per_tick)
|
return
|
||||||
account.adjust_money(-siphoned)
|
|
||||||
credits_stored += siphoned
|
var/datum/bank_account/account = SSeconomy.get_dep_account(ACCOUNT_CAR)
|
||||||
interrupt_research()
|
var/siphoned = min(account.account_balance,siphon_per_tick)
|
||||||
else
|
account.adjust_money(-siphoned)
|
||||||
return
|
credits_stored += siphoned
|
||||||
else
|
interrupt_research()
|
||||||
STOP_PROCESSING(SSobj,src)
|
|
||||||
|
|
||||||
///Turns on the siphoning, and its various side effects
|
///Turns on the siphoning, and its various side effects
|
||||||
/obj/machinery/shuttle_scrambler/proc/toggle_on(mob/user)
|
/obj/machinery/shuttle_scrambler/proc/toggle_on(mob/user)
|
||||||
|
|||||||
@@ -60,6 +60,7 @@
|
|||||||
spawn_amt_left--
|
spawn_amt_left--
|
||||||
if(spawn_amt_left <= 0)
|
if(spawn_amt_left <= 0)
|
||||||
qdel(src)
|
qdel(src)
|
||||||
|
return PROCESS_KILL
|
||||||
|
|
||||||
/obj/effect/rend/attackby(obj/item/I, mob/user, params)
|
/obj/effect/rend/attackby(obj/item/I, mob/user, params)
|
||||||
if(istype(I, /obj/item/nullrod))
|
if(istype(I, /obj/item/nullrod))
|
||||||
|
|||||||
@@ -46,25 +46,30 @@
|
|||||||
to_chat(user, span_notice("You toggle [src] to \"detect critical state\" mode."))
|
to_chat(user, span_notice("You toggle [src] to \"detect critical state\" mode."))
|
||||||
|
|
||||||
/obj/item/assembly/health/process()
|
/obj/item/assembly/health/process()
|
||||||
|
//not ready yet
|
||||||
if(!scanning || !secured)
|
if(!scanning || !secured)
|
||||||
return
|
return
|
||||||
|
|
||||||
var/atom/A = src
|
//look for a mob in either our location or in the connected holder
|
||||||
|
var/atom/object = src
|
||||||
if(connected?.holder)
|
if(connected?.holder)
|
||||||
A = connected.holder
|
object = connected.holder
|
||||||
for(A, A && !ismob(A), A=A.loc);
|
while(!ismob(object))
|
||||||
// like get_turf(), but for mobs.
|
object = object.loc
|
||||||
var/mob/living/M = A
|
if(isnull(object)) //we went too far
|
||||||
|
return
|
||||||
|
|
||||||
if(M)
|
//only do the pulse if we are within alarm thresholds
|
||||||
health_scan = M.health
|
var/mob/living/target_mob = object
|
||||||
if(health_scan <= alarm_health)
|
health_scan = target_mob.health
|
||||||
pulse()
|
if(health_scan > alarm_health)
|
||||||
audible_message("<span class='infoplain'>[icon2html(src, hearers(src))] *beep* *beep* *beep*</span>")
|
|
||||||
playsound(src, 'sound/machines/triple_beep.ogg', ASSEMBLY_BEEP_VOLUME, TRUE)
|
|
||||||
toggle_scan()
|
|
||||||
return
|
return
|
||||||
return
|
|
||||||
|
//do the pulse & the scan
|
||||||
|
pulse()
|
||||||
|
audible_message("<span class='infoplain'>[icon2html(src, hearers(src))] *beep* *beep* *beep*</span>")
|
||||||
|
playsound(src, 'sound/machines/triple_beep.ogg', ASSEMBLY_BEEP_VOLUME, TRUE)
|
||||||
|
toggle_scan()
|
||||||
|
|
||||||
/obj/item/assembly/health/proc/toggle_scan()
|
/obj/item/assembly/health/proc/toggle_scan()
|
||||||
if(!secured)
|
if(!secured)
|
||||||
|
|||||||
@@ -285,7 +285,6 @@
|
|||||||
AddElement(/datum/element/gags_recolorable)
|
AddElement(/datum/element/gags_recolorable)
|
||||||
|
|
||||||
/obj/item/clothing/suit/hooded/hostile_environment/process(seconds_per_tick)
|
/obj/item/clothing/suit/hooded/hostile_environment/process(seconds_per_tick)
|
||||||
. = ..()
|
|
||||||
var/mob/living/carbon/wearer = loc
|
var/mob/living/carbon/wearer = loc
|
||||||
if(istype(wearer) && SPT_PROB(1, seconds_per_tick)) //cursed by bubblegum
|
if(istype(wearer) && SPT_PROB(1, seconds_per_tick)) //cursed by bubblegum
|
||||||
if(prob(7.5))
|
if(prob(7.5))
|
||||||
|
|||||||
@@ -173,8 +173,8 @@
|
|||||||
//We use SSfastprocess for the program icon state because it runs faster than process_tick() does.
|
//We use SSfastprocess for the program icon state because it runs faster than process_tick() does.
|
||||||
/datum/computer_file/program/radar/process()
|
/datum/computer_file/program/radar/process()
|
||||||
if(computer.active_program != src)
|
if(computer.active_program != src)
|
||||||
STOP_PROCESSING(SSfastprocess, src) //We're not the active program, it's time to stop.
|
//We're not the active program, it's time to stop.
|
||||||
return
|
return PROCESS_KILL
|
||||||
if(!selected)
|
if(!selected)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
@@ -96,7 +96,6 @@
|
|||||||
add_avail(power_output)
|
add_avail(power_output)
|
||||||
lastgenlev = power_output
|
lastgenlev = power_output
|
||||||
lastgen -= power_output
|
lastgen -= power_output
|
||||||
..()
|
|
||||||
|
|
||||||
/obj/machinery/power/generator/proc/get_menu(include_link = TRUE)
|
/obj/machinery/power/generator/proc/get_menu(include_link = TRUE)
|
||||||
var/t = ""
|
var/t = ""
|
||||||
|
|||||||
@@ -22,7 +22,6 @@
|
|||||||
connect_to_network()
|
connect_to_network()
|
||||||
|
|
||||||
/obj/machinery/power/rtg/process()
|
/obj/machinery/power/rtg/process()
|
||||||
..()
|
|
||||||
add_avail(power_gen)
|
add_avail(power_gen)
|
||||||
|
|
||||||
/obj/machinery/power/rtg/RefreshParts()
|
/obj/machinery/power/rtg/RefreshParts()
|
||||||
|
|||||||
@@ -77,7 +77,6 @@
|
|||||||
|
|
||||||
|
|
||||||
/obj/machinery/smoke_machine/process()
|
/obj/machinery/smoke_machine/process()
|
||||||
..()
|
|
||||||
if(reagents.total_volume == 0)
|
if(reagents.total_volume == 0)
|
||||||
on = FALSE
|
on = FALSE
|
||||||
update_appearance()
|
update_appearance()
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ Stabilized extracts:
|
|||||||
if (holder.has_status_effect(effectpath))
|
if (holder.has_status_effect(effectpath))
|
||||||
return
|
return
|
||||||
holder.apply_status_effect(effectpath, src)
|
holder.apply_status_effect(effectpath, src)
|
||||||
STOP_PROCESSING(SSobj,src)
|
return PROCESS_KILL
|
||||||
|
|
||||||
//Colors and subtypes:
|
//Colors and subtypes:
|
||||||
/obj/item/slimecross/stabilized/grey
|
/obj/item/slimecross/stabilized/grey
|
||||||
|
|||||||
@@ -89,7 +89,7 @@
|
|||||||
/obj/machinery/satellite/meteor_shield/process()
|
/obj/machinery/satellite/meteor_shield/process()
|
||||||
if(obj_flags & EMAGGED)
|
if(obj_flags & EMAGGED)
|
||||||
//kills the processing because emagged meteor shields no longer stop meteors in any way
|
//kills the processing because emagged meteor shields no longer stop meteors in any way
|
||||||
return ..()
|
return PROCESS_KILL
|
||||||
if(!active)
|
if(!active)
|
||||||
return
|
return
|
||||||
for(var/obj/effect/meteor/meteor_to_destroy in GLOB.meteor_list)
|
for(var/obj/effect/meteor/meteor_to_destroy in GLOB.meteor_list)
|
||||||
|
|||||||
Reference in New Issue
Block a user