Skip to content

Commit

Permalink
Bug Fixes and Monitoring (#1949)
Browse files Browse the repository at this point in the history
* Initial Commit

* Update _lists.dm

* More fixes
  • Loading branch information
LanceSmites328 authored May 1, 2024
1 parent ee64ab9 commit 6239909
Show file tree
Hide file tree
Showing 15 changed files with 52 additions and 25 deletions.
3 changes: 3 additions & 0 deletions code/__HELPERS/game.dm
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,9 @@

/proc/get_hearers_in_view(R, atom/source)
// Returns a list of hearers in view(R) from source (ignoring luminosity). Used in saycode.
if(!isnum(R))
stack_trace("invalid get_hearers_in_view call on [source] with an range [R]")
return list()
var/turf/T = get_turf(source)
. = list()
if(!T)
Expand Down
5 changes: 4 additions & 1 deletion code/__HELPERS/icon_smoothing.dm
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,10 @@ DEFINE_BITFIELD(smoothing_junction, list(
var/new_junction = NONE

for(var/direction in GLOB.cardinals) //Cardinal case first.
SET_ADJ_IN_DIR(src, new_junction, direction, direction)
try
SET_ADJ_IN_DIR(src, new_junction, direction, direction)
catch(var/exception/except)
CRASH("[src] tried smoothing but failed; [except]")

if(!(new_junction & (NORTH|SOUTH)) || !(new_junction & (EAST|WEST)))
set_smoothed_icon_state(new_junction)
Expand Down
2 changes: 2 additions & 0 deletions code/_onclick/hud/alien.dm
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@
if(!mymob)
return
var/mob/living/carbon/alien/humanoid/H = mymob
if(!H.client)
return
if(hud_version != HUD_STYLE_NOHUD)
for(var/obj/item/I in H.held_items)
I.screen_loc = ui_hand_position(H.get_held_index_of_item(I))
Expand Down
2 changes: 2 additions & 0 deletions code/_onclick/hud/generic_dextrous.dm
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@
if(!mymob)
return
var/mob/living/D = mymob
if(!D.client)
return
if(hud_version != HUD_STYLE_NOHUD)
for(var/obj/item/I in D.held_items)
I.screen_loc = ui_hand_position(D.get_held_index_of_item(I))
Expand Down
2 changes: 1 addition & 1 deletion code/_onclick/hud/guardian.dm
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
static_inventory += using

/datum/hud/dextrous/guardian/persistent_inventory_update()
if(!mymob)
if(!mymob || !mymob.client)
return
if(istype(mymob, /mob/living/simple_animal/hostile/guardian/dextrous))
var/mob/living/simple_animal/hostile/guardian/dextrous/D = mymob
Expand Down
2 changes: 2 additions & 0 deletions code/_onclick/hud/hud.dm
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,8 @@ GLOBAL_LIST_INIT(available_ui_styles, list(
return TRUE

/datum/hud/proc/plane_masters_update()
if(!mymob.client)
return
// Plane masters are always shown to OUR mob, never to observers
for(var/thing in plane_masters)
var/atom/movable/screen/plane_master/PM = plane_masters[thing]
Expand Down
3 changes: 3 additions & 0 deletions code/datums/components/_component.dm
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,9 @@
* * sig_typeor_types Signal string key or list of signal keys to stop listening to specifically
*/
/datum/proc/UnregisterSignal(datum/target, sig_type_or_types)
if(!target)
stack_trace("Unregister Signal called without a target by [src].")
return
var/list/lookup = target.comp_lookup
if(!signal_procs || !signal_procs[target] || !lookup)
return
Expand Down
2 changes: 2 additions & 0 deletions code/datums/quirks/negative.dm
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,8 @@
RegisterSignal(quirk_holder, COMSIG_MOB_EXAMINATE, PROC_REF(looks_at_floor))

/datum/quirk/social_anxiety/remove()
if(!quirk_holder)
return
UnregisterSignal(quirk_holder, list(COMSIG_MOB_EYECONTACT, COMSIG_MOB_EXAMINATE))

/datum/quirk/social_anxiety/on_process(delta_time)
Expand Down
23 changes: 14 additions & 9 deletions code/game/atoms_movable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -376,15 +376,20 @@
var/area/newarea = get_area(newloc)
loc = newloc
. = TRUE
oldloc.Exited(src, newloc)
if(oldarea != newarea)
oldarea.Exited(src, newloc)
if(!oldloc)
stack_trace("[src] moved out of nullspace/null loc")
else
oldloc.Exited(src, newloc)

for(var/i in oldloc)
if(i == src) // Multi tile objects
continue
var/atom/movable/thing = i
thing.Uncrossed(src)
for(var/i in oldloc)
if(i == src) // Multi tile objects
continue
var/atom/movable/thing = i
thing.Uncrossed(src)

if(oldarea)
if(oldarea != newarea)
oldarea.Exited(src, newloc)

newloc.Entered(src, oldloc)
if(oldarea != newarea)
Expand Down Expand Up @@ -560,7 +565,7 @@
if(destination)
. = doMove(destination)
else
CRASH("No valid destination passed into forceMove")
CRASH("No valid destination passed into forceMove on [src]")

/atom/movable/proc/moveToNullspace()
return doMove(null)
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/ego_weapons/waw.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1913,7 +1913,7 @@
speed_slowdown = 1
throwforce = 100//TIME TO DIE!
to_chat(user,span_warning("You put your strength behind this attack."))
power_timer = addtimer(CALLBACK(src, PROC_REF(PowerReset)), 3 SECONDS,user, TIMER_STOPPABLE)//prevents storing 3 powered up anchors and unloading all of them at once
power_timer = addtimer(CALLBACK(src, PROC_REF(PowerReset)), 3 SECONDS, TIMER_STOPPABLE)//prevents storing 3 powered up anchors and unloading all of them at once

/obj/item/ego_weapon/blind_obsession/proc/PowerReset(mob/user)
to_chat(user, span_warning("You lose your balance while holding [src]."))
Expand Down
6 changes: 2 additions & 4 deletions code/game/turfs/change_turf.dm
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,7 @@ GLOBAL_LIST_INIT(blacklisted_automated_baseturfs, typecacheof(list(
var/energy = 0
var/heat_cap = 0

for(var/t in turf_list)
var/turf/open/T = t
for(var/turf/open/T in turf_list)
//Cache?
var/datum/gas_mixture/turf/mix = T.air
//"borrowing" this code from merge(), I need to play with the temp portion. Lets expand it out
Expand All @@ -339,8 +338,7 @@ GLOBAL_LIST_INIT(blacklisted_automated_baseturfs, typecacheof(list(
for(var/id in total_gases)
total_gases[id][MOLES] /= turflen

for(var/t in turf_list)
var/turf/open/T = t
for(var/turf/open/T in turf_list)
T.air.copy_from(total)
T.update_visuals()
SSair.add_to_active(T)
Expand Down
14 changes: 7 additions & 7 deletions code/modules/atmospherics/environmental/LINDA_turf_tile.dm
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,10 @@
temperature_archived = temperature

/turf/open/archive()
air.archive()
if(!air)
stack_trace("[src] tried to archive null air at [x]x-[y]y-[z]z")
else
air.archive()
archived_cycle = SSair.times_fired
temperature_archived = temperature

Expand Down Expand Up @@ -257,8 +260,7 @@
max_share = 0 //Gotta reset our tracker
#endif

for(var/t in adjacent_turfs)
var/turf/open/enemy_tile = t
for(var/turf/open/enemy_tile in adjacent_turfs)

if(fire_count <= enemy_tile.current_cycle)
continue
Expand Down Expand Up @@ -472,8 +474,7 @@
var/energy = 0
var/heat_cap = 0

for(var/t in turf_list)
var/turf/open/T = t
for(var/turf/open/T in turf_list)
//Cache?
var/datum/gas_mixture/turf/mix = T.air
if (roundstart && istype(T.air, /datum/gas_mixture/immutable))
Expand All @@ -498,8 +499,7 @@
A_gases[id][MOLES] /= turflen
A.garbage_collect()

for(var/t in turf_list)
var/turf/open/T = t
for(var/turf/open/T in turf_list)
if(T.planetary_atmos) //We do this as a hack to try and minimize unneeded excited group spread over planetary turfs
T.air.copy_from(SSair.planetary[T.initial_gas_mix]) //Comes with a cost of "slower" drains, but it's worth it
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,8 @@
if(get_dist(src, J) < 6) // Unnecessary for this distance
continue
target_turfs += get_turf(J)

if(!LAZYLEN(target_turfs))
return ..()
var/turf/target_turf = pick(target_turfs)
if(istype(target_turf))
patrol_path = get_path_to(src, target_turf, TYPE_PROC_REF(/turf, Distance_cardinal), 0, 200)
Expand Down
5 changes: 4 additions & 1 deletion code/modules/projectiles/projectile.dm
Original file line number Diff line number Diff line change
Expand Up @@ -486,8 +486,11 @@
//Returns true if the target atom is on our current turf and above the right layer
//If direct target is true it's the originally clicked target.
/obj/projectile/proc/can_hit_target(atom/target, direct_target = FALSE, ignore_loc = FALSE, cross_failed = FALSE)
if(QDELETED(target) || impacted[target])
if(QDELETED(target))
return FALSE
if(target in impacted)
if(impacted[target])
return FALSE
if(!ignore_loc && (loc != target.loc))
return FALSE
// if pass_flags match, pass through entirely - unless direct target is set.
Expand Down
3 changes: 3 additions & 0 deletions code/modules/shuttle/arrivals.dm
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@
/obj/docking_port/mobile/arrivals/proc/CheckTurfsPressure()
for(var/I in SSjob.latejoin_trackers)
var/turf/open/T = get_turf(I)
if(!istype(T))
stack_trace("Closed Turf in SSjob.latejoin_trackers was checked for air pressure.")
continue
var/pressure = T.air.return_pressure()
if(pressure < HAZARD_LOW_PRESSURE || pressure > HAZARD_HIGH_PRESSURE) //simple safety check
return TRUE
Expand Down

0 comments on commit 6239909

Please sign in to comment.