From ac29f4ea853715513840c0e2a8031c341a218f64 Mon Sep 17 00:00:00 2001 From: Lucy Date: Sat, 24 Aug 2024 21:00:06 -0400 Subject: [PATCH] Revert "Revert "various minor /tg/ bugfixes"" (#3107) * Revert "Revert "various minor /tg/ bugfixes (#2505)" (#3038)" This reverts commit 56fac5f161314337c54c174efd152a80791ab111. * Revert https://github.com/Monkestation/Monkestation2.0/pull/2505/commits/aeeeb78b90d2329a43fa3857ec671a067c29eac5 --- code/__DEFINES/spatial_gridmap.dm | 9 ++ code/__HELPERS/areas.dm | 2 +- code/_compile_options.dm | 2 +- code/_onclick/hud/action_button.dm | 6 +- code/controllers/subsystem/spatial_gridmap.dm | 109 +++++++++++++++--- code/datums/brain_damage/severe.dm | 6 +- code/datums/elements/forced_gravity.dm | 6 +- code/datums/progressbar.dm | 4 +- .../proximity_monitor/fields/gravity.dm | 3 +- code/game/objects/effects/spiderwebs.dm | 10 +- code/game/objects/items/melee/baton.dm | 13 ++- code/game/world.dm | 1 + code/modules/admin/IsBanned.dm | 4 +- .../atmospherics/machinery/other/meter.dm | 4 +- code/modules/logging/log_holder.dm | 8 +- code/modules/mapping/reader.dm | 1 + .../guardian/guardian_types/protector.dm | 2 +- code/modules/mob/living/carbon/carbon.dm | 2 +- code/modules/mob/living/carbon/death.dm | 4 +- code/modules/mob/living/carbon/human/human.dm | 2 +- code/modules/mob/living/living_movement.dm | 3 +- 21 files changed, 154 insertions(+), 47 deletions(-) diff --git a/code/__DEFINES/spatial_gridmap.dm b/code/__DEFINES/spatial_gridmap.dm index 85462c11bb9f..f43fcbc3c6d3 100644 --- a/code/__DEFINES/spatial_gridmap.dm +++ b/code/__DEFINES/spatial_gridmap.dm @@ -2,6 +2,7 @@ #define SPATIAL_GRID_CELLSIZE 17 ///Takes a coordinate, and spits out the spatial grid index (x or y) it's inside #define GET_SPATIAL_INDEX(coord) ROUND_UP((coord) / SPATIAL_GRID_CELLSIZE) +#define GRID_INDEX_TO_COORDS(index) (index * SPATIAL_GRID_CELLSIZE) #define SPATIAL_GRID_CELLS_PER_SIDE(world_bounds) GET_SPATIAL_INDEX(world_bounds) #define SPATIAL_GRID_CHANNELS 2 @@ -15,6 +16,8 @@ ///all atmos machines are stored in this channel (I'm sorry kyler) #define SPATIAL_GRID_CONTENTS_TYPE_ATMOS "spatial_grid_contents_type_atmos" +#define ALL_CONTENTS_OF_CELL(cell) (cell.hearing_contents | cell.client_contents | cell.atmos_contents) + ///whether movable is itself or containing something which should be in one of the spatial grid channels. #define HAS_SPATIAL_GRID_CONTENTS(movable) (movable.spatial_grid_key) @@ -43,3 +46,9 @@ if(!length(cell_contents_list)) {\ cell_contents_list = dummy_list; \ }; + +///remove from every list +#define GRID_CELL_REMOVE_ALL(cell, movable) \ + GRID_CELL_REMOVE(cell.hearing_contents, movable) \ + GRID_CELL_REMOVE(cell.client_contents, movable) \ + GRID_CELL_REMOVE(cell.atmos_contents, movable) diff --git a/code/__HELPERS/areas.dm b/code/__HELPERS/areas.dm index 18b50c16faec..bb688b4655fb 100644 --- a/code/__HELPERS/areas.dm +++ b/code/__HELPERS/areas.dm @@ -160,7 +160,7 @@ GLOBAL_LIST_INIT(typecache_powerfailure_safe_areas, typecacheof(list( //inform atoms on the turf that their area has changed for(var/atom/stuff as anything in the_turf) //unregister the stuff from its old area - SEND_SIGNAL(stuff, COMSIG_EXIT_AREA, oldA) + SEND_SIGNAL(stuff, COMSIG_EXIT_AREA, old_area) //register the stuff to its new area. special exception for apc as its not registered to this signal if(istype(stuff, /obj/machinery/power/apc)) diff --git a/code/_compile_options.dm b/code/_compile_options.dm index c64d99251d92..69519a66b735 100644 --- a/code/_compile_options.dm +++ b/code/_compile_options.dm @@ -98,7 +98,7 @@ #endif #ifndef PRELOAD_RSC //set to: -#define PRELOAD_RSC 2 // 0 to allow using external resources or on-demand behaviour; +#define PRELOAD_RSC 1 // 0 to allow using external resources or on-demand behaviour; #endif // 1 to use the default behaviour; // 2 for preloading absolutely everything; diff --git a/code/_onclick/hud/action_button.dm b/code/_onclick/hud/action_button.dm index 3092722c79df..dd90e9c77fd9 100644 --- a/code/_onclick/hud/action_button.dm +++ b/code/_onclick/hud/action_button.dm @@ -94,7 +94,7 @@ old_object.MouseExited(over_location, over_control, params) last_hovored_ref = WEAKREF(over_object) - over_object.MouseEntered(over_location, over_control, params) + over_object?.MouseEntered(over_location, over_control, params) /atom/movable/screen/movable/action_button/MouseEntered(location, control, params) . = ..() @@ -230,7 +230,7 @@ return for(var/datum/action/action as anything in take_from.actions) - if(!action.show_to_observers) + if(!action.show_to_observers || !action.owner_has_control) continue action.GiveAction(src) RegisterSignal(take_from, COMSIG_MOB_GRANTED_ACTION, PROC_REF(on_observing_action_granted), TRUE) @@ -251,7 +251,7 @@ /mob/proc/on_observing_action_granted(mob/living/source, datum/action/action) SIGNAL_HANDLER - if(!action.show_to_observers) + if(!action.show_to_observers || !action.owner_has_control) return action.GiveAction(src) diff --git a/code/controllers/subsystem/spatial_gridmap.dm b/code/controllers/subsystem/spatial_gridmap.dm index c6c90b612c7b..1b097994a956 100644 --- a/code/controllers/subsystem/spatial_gridmap.dm +++ b/code/controllers/subsystem/spatial_gridmap.dm @@ -482,21 +482,106 @@ SUBSYSTEM_DEF(spatial_grid) return TRUE -///find the cell this movable is associated with and removes it from all lists -/datum/controller/subsystem/spatial_grid/proc/force_remove_from_cell(atom/movable/to_remove, datum/spatial_grid_cell/input_cell) +/// if for whatever reason this movable is "untracked" e.g. it breaks the assumption that a movable is only inside the contents of any grid cell associated with its loc, +/// this will error. this checks every grid cell in the world so dont call this on live unless you have to. +/// returns TRUE if this movable is untracked, FALSE otherwise +/datum/controller/subsystem/spatial_grid/proc/untracked_movable_error(atom/movable/movable_to_check) + if(!movable_to_check?.spatial_grid_key) + return FALSE + + if(!initialized) + return FALSE + + var/datum/spatial_grid_cell/loc_cell = get_cell_of(movable_to_check) + var/list/containing_cells = find_hanging_cell_refs_for_movable(movable_to_check, remove_from_cells=FALSE) + //if we're in multiple cells, throw an error. + //if we're in 1 cell but it cant be deduced by our location, throw an error. + if(length(containing_cells) > 1 || (length(containing_cells) == 1 && loc_cell && containing_cells[1] != loc_cell && containing_cells[1] != null)) + var/error_data = "" + + var/location_string = "which is in nullspace, and thus not be within the contents of any spatial grid cell" + if(loc_cell) + location_string = "which is supposed to only be in the contents of a spatial grid cell at coords: ([GRID_INDEX_TO_COORDS(loc_cell.cell_x)], [GRID_INDEX_TO_COORDS(loc_cell.cell_y)], [loc_cell.cell_z])" + + var/error_explanation = "was in the contents of [length(containing_cells)] spatial grid cells when it was only supposed to be in one!" + if(length(containing_cells) == 1) + error_explanation = "was in the contents of 1 spatial grid cell but it was inside the area handled by another grid cell!" + var/datum/spatial_grid_cell/bad_cell = containing_cells[1] + + error_data = "within the contents of a cell at coords: ([GRID_INDEX_TO_COORDS(bad_cell.cell_x)], [GRID_INDEX_TO_COORDS(bad_cell.cell_y)], [bad_cell.cell_z])" + + if(!error_data) + for(var/datum/spatial_grid_cell/cell in containing_cells) + var/coords = "([GRID_INDEX_TO_COORDS(cell.cell_x)], [GRID_INDEX_TO_COORDS(cell.cell_y)], [cell.cell_z])" + var/contents = "" + + if(movable_to_check in cell.hearing_contents) + contents = "hearing" + + if(movable_to_check in cell.client_contents) + if(length(contents) > 0) + contents = "[contents], client" + else + contents = "client" + + if(movable_to_check in cell.atmos_contents) + if(length(contents) > 0) + contents = "[contents], atmos" + else + contents = "atmos" + + if(length(error_data) > 0) + error_data = "[error_data], {coords: [coords], within channels: [contents]}" + else + error_data = "within the contents of the following cells: {coords: [coords], within channels: [contents]}" + + /** + * example: + * + * /mob/living/trolls_the_maintainer instance, which is supposed to only be in the contents of a spatial grid cell at coords: (136, 136, 14), + * was in the contents of 3 spatial grid cells when it was only supposed to be in one! within the contents of the following cells: + * {(68, 153, 2), within channels: hearing}, + * {coords: (221, 170, 3), within channels: hearing}, + * {coords: (255, 153, 11), within channels: hearing}, + * {coords: (136, 136, 14), within channels: hearing}. + */ + stack_trace("[movable_to_check.type] instance, [location_string], [error_explanation] [error_data].") + + return TRUE + + return FALSE + +/** + * remove this movable from the grid by finding the grid cell its in and removing it from that. + * if it cant infer a grid cell its located in (e.g. if its in nullspace but it can happen if the grid isnt expanded to a z level), search every grid cell. + */ +/datum/controller/subsystem/spatial_grid/proc/force_remove_from_grid(atom/movable/to_remove) + if(!to_remove?.spatial_grid_key) + return + if(!initialized) remove_from_pre_init_queue(to_remove)//the spatial grid doesnt exist yet, so just take it out of the queue return +#ifdef UNIT_TESTS + if(untracked_movable_error(to_remove)) + find_hanging_cell_refs_for_movable(to_remove, remove_from_cells=TRUE) + return +#endif + + var/datum/spatial_grid_cell/loc_cell = get_cell_of(to_remove) + + if(loc_cell) + GRID_CELL_REMOVE_ALL(loc_cell, to_remove) + else + find_hanging_cell_refs_for_movable(to_remove, remove_from_cells=TRUE) + +///remove this movable from the given spatial_grid_cell +/datum/controller/subsystem/spatial_grid/proc/force_remove_from_cell(atom/movable/to_remove, datum/spatial_grid_cell/input_cell) if(!input_cell) - input_cell = get_cell_of(to_remove) - if(!input_cell) - find_hanging_cell_refs_for_movable(to_remove, TRUE) - return + return - GRID_CELL_REMOVE(input_cell.client_contents, to_remove) - GRID_CELL_REMOVE(input_cell.hearing_contents, to_remove) - GRID_CELL_REMOVE(input_cell.atmos_contents, to_remove) + GRID_CELL_REMOVE_ALL(input_cell, to_remove) ///if shit goes south, this will find hanging references for qdeleting movables inside the spatial grid /datum/controller/subsystem/spatial_grid/proc/find_hanging_cell_refs_for_movable(atom/movable/to_remove, remove_from_cells = TRUE) @@ -526,7 +611,7 @@ SUBSYSTEM_DEF(spatial_grid) ///debug proc for checking if a movable is in multiple cells when it shouldnt be (ie always unless multitile entering is implemented) /atom/proc/find_all_cells_containing(remove_from_cells = FALSE) var/datum/spatial_grid_cell/real_cell = SSspatial_grid.get_cell_of(src) - var/list/containing_cells = SSspatial_grid.find_hanging_cell_refs_for_movable(src, FALSE, remove_from_cells) + var/list/containing_cells = SSspatial_grid.find_hanging_cell_refs_for_movable(src, remove_from_cells) message_admins("[src] is located in the contents of [length(containing_cells)] spatial grid cells") @@ -758,7 +843,5 @@ SUBSYSTEM_DEF(spatial_grid) #undef BOUNDING_BOX_MAX #undef BOUNDING_BOX_MIN -#undef GRID_CELL_ADD -#undef GRID_CELL_REMOVE -#undef GRID_CELL_SET + #undef NUMBER_OF_PREGENERATED_ORANGES_EARS diff --git a/code/datums/brain_damage/severe.dm b/code/datums/brain_damage/severe.dm index e19cde3daa97..e517742bd217 100644 --- a/code/datums/brain_damage/severe.dm +++ b/code/datums/brain_damage/severe.dm @@ -33,8 +33,10 @@ ..() /datum/brain_trauma/severe/aphasia/on_lose() - owner.remove_blocked_language(subtypesof(/datum/language/), LANGUAGE_APHASIA) - owner.remove_language(/datum/language/aphasia, TRUE, TRUE, LANGUAGE_APHASIA) + if(!QDELING(owner)) + owner.remove_blocked_language(subtypesof(/datum/language/), LANGUAGE_APHASIA) + owner.remove_language(/datum/language/aphasia, TRUE, TRUE, LANGUAGE_APHASIA) + ..() /datum/brain_trauma/severe/blindness diff --git a/code/datums/elements/forced_gravity.dm b/code/datums/elements/forced_gravity.dm index bedda891fb5f..5be4ffe63946 100644 --- a/code/datums/elements/forced_gravity.dm +++ b/code/datums/elements/forced_gravity.dm @@ -6,7 +6,7 @@ ///whether we will override the turf if it forces no gravity var/ignore_turf_gravity -/datum/element/forced_gravity/Attach(datum/target, gravity = 1, ignore_turf_gravity = FALSE) +/datum/element/forced_gravity/Attach(datum/target, gravity = 1, ignore_turf_gravity = FALSE, can_override = FALSE) . = ..() if(!isatom(target)) return ELEMENT_INCOMPATIBLE @@ -14,9 +14,9 @@ src.gravity = gravity src.ignore_turf_gravity = ignore_turf_gravity - RegisterSignal(target, COMSIG_ATOM_HAS_GRAVITY, PROC_REF(gravity_check)) + RegisterSignal(target, COMSIG_ATOM_HAS_GRAVITY, PROC_REF(gravity_check), override = can_override) if(isturf(target)) - RegisterSignal(target, COMSIG_TURF_HAS_GRAVITY, PROC_REF(turf_gravity_check)) + RegisterSignal(target, COMSIG_TURF_HAS_GRAVITY, PROC_REF(turf_gravity_check), override = can_override) ADD_TRAIT(target, TRAIT_FORCED_GRAVITY, REF(src)) diff --git a/code/datums/progressbar.dm b/code/datums/progressbar.dm index 5d352ad0f4d1..ac943f525e4f 100644 --- a/code/datums/progressbar.dm +++ b/code/datums/progressbar.dm @@ -37,7 +37,9 @@ /datum/progressbar/New(mob/User, goal_number, atom/target, border_look = "border", border_look_accessory, bar_look = "prog_bar", old_format = FALSE, active_color = "#6699FF", finish_color = "#FFEE8C", fail_color = "#FF0033" , mutable_appearance/additional_image) . = ..() if (!istype(target)) - EXCEPTION("Invalid target given") + stack_trace("Invalid target [target] passed in") + qdel(src) + return if(QDELETED(User) || !istype(User)) stack_trace("/datum/progressbar created with [isnull(User) ? "null" : "invalid"] user") qdel(src) diff --git a/code/datums/proximity_monitor/fields/gravity.dm b/code/datums/proximity_monitor/fields/gravity.dm index e341c36c9b18..ac9b143c2083 100644 --- a/code/datums/proximity_monitor/fields/gravity.dm +++ b/code/datums/proximity_monitor/fields/gravity.dm @@ -12,8 +12,7 @@ . = ..() if (isnull(modified_turfs[target])) return - - target.AddElement(/datum/element/forced_gravity, gravity_value) + target.AddElement(/datum/element/forced_gravity, gravity_value, can_override = TRUE) modified_turfs[target] = gravity_value /datum/proximity_monitor/advanced/gravity/cleanup_field_turf(turf/target) diff --git a/code/game/objects/effects/spiderwebs.dm b/code/game/objects/effects/spiderwebs.dm index f067f0c17bf8..269f3d6edafc 100644 --- a/code/game/objects/effects/spiderwebs.dm +++ b/code/game/objects/effects/spiderwebs.dm @@ -43,9 +43,9 @@ return if(!HAS_TRAIT(user,TRAIT_WEB_WEAVER)) return - user.balloon_alert_to_viewers("weaving...") + loc.balloon_alert_to_viewers("weaving...") if(!do_after(user, 2 SECONDS)) - user.balloon_alert(user, "interrupted!") + loc.balloon_alert(user, "interrupted!") return qdel(src) var/obj/item/stack/sheet/cloth/woven_cloth = new /obj/item/stack/sheet/cloth @@ -68,7 +68,7 @@ if(mover.pulledby && HAS_TRAIT(mover.pulledby, TRAIT_WEB_SURFER)) return TRUE if(prob(50)) - balloon_alert(mover, "stuck in web!") + loc.balloon_alert(mover, "stuck in web!") return FALSE else if(isprojectile(mover)) return prob(30) @@ -100,7 +100,7 @@ if(mover.pulledby == allowed_mob) return TRUE if(prob(50)) - balloon_alert(mover, "stuck in web!") + loc.balloon_alert(mover, "stuck in web!") return FALSE else if(isprojectile(mover)) return prob(30) @@ -180,7 +180,7 @@ return if(!isnull(mover.pulledby) && isspider(mover.pulledby)) return TRUE - balloon_alert(mover, "stuck in web!") + loc.balloon_alert(mover, "stuck in web!") return FALSE /obj/structure/spider/spikes diff --git a/code/game/objects/items/melee/baton.dm b/code/game/objects/items/melee/baton.dm index 6e7bef5883e3..d06b0067de24 100644 --- a/code/game/objects/items/melee/baton.dm +++ b/code/game/objects/items/melee/baton.dm @@ -787,9 +787,10 @@ if(!.) return var/obj/item/stuff_in_hand = target.get_active_held_item() - if(stuff_in_hand && target.temporarilyRemoveItemFromInventory(stuff_in_hand)) - if(user.put_in_inactive_hand(stuff_in_hand)) - stuff_in_hand.loc.visible_message(span_warning("[stuff_in_hand] suddenly appears in [user]'s hand!")) - else - stuff_in_hand.forceMove(user.drop_location()) - stuff_in_hand.loc.visible_message(span_warning("[stuff_in_hand] suddenly appears!")) + if(!user || !stuff_in_hand || !target.temporarilyRemoveItemFromInventory(stuff_in_hand)) + return + if(user.put_in_inactive_hand(stuff_in_hand)) + stuff_in_hand.loc.visible_message(span_warning("[stuff_in_hand] suddenly appears in [user]'s hand!")) + else + stuff_in_hand.forceMove(user.drop_location()) + stuff_in_hand.loc.visible_message(span_warning("[stuff_in_hand] suddenly appears!")) diff --git a/code/game/world.dm b/code/game/world.dm index 43f9aad06e9c..6a071e02ef82 100644 --- a/code/game/world.dm +++ b/code/game/world.dm @@ -330,6 +330,7 @@ GLOBAL_VAR(restart_counter) shutdown_logging() // See comment below. auxcleanup() TgsEndProcess() + return ..() log_world("World rebooted at [time_stamp()]") diff --git a/code/modules/admin/IsBanned.dm b/code/modules/admin/IsBanned.dm index 6df75daf2425..fa1b832ecc31 100644 --- a/code/modules/admin/IsBanned.dm +++ b/code/modules/admin/IsBanned.dm @@ -43,13 +43,15 @@ var/client_is_in_db = query_client_in_db.NextRow() if(!client_is_in_db) - var/reject_message = "Failed Login: [ckey] [address]-[computer_id] - New Account attempting to connect during panic bunker, but was rejected due to no prior connections to game servers (no database entry)" log_access(reject_message) if (message) message_admins(span_adminnotice("[reject_message]")) + qdel(query_client_in_db) return list("reason"="panicbunker", "desc" = "Sorry but the server is currently not accepting connections from never before seen players") + qdel(query_client_in_db) + //Whitelist if(!real_bans_only && !C && CONFIG_GET(flag/usewhitelist)) if(!check_whitelist(ckey)) diff --git a/code/modules/atmospherics/machinery/other/meter.dm b/code/modules/atmospherics/machinery/other/meter.dm index 99aa175529f2..22223cb0e784 100644 --- a/code/modules/atmospherics/machinery/other/meter.dm +++ b/code/modules/atmospherics/machinery/other/meter.dm @@ -62,8 +62,8 @@ return target?.return_air() || ..() /obj/machinery/meter/process_atmos() - var/datum/gas_mixture/pipe_air = target.return_air() - if(!pipe_air) + var/datum/gas_mixture/pipe_air = target?.return_air() + if(isnull(pipe_air)) icon_state = "meter0" return FALSE diff --git a/code/modules/logging/log_holder.dm b/code/modules/logging/log_holder.dm index ecfdf5d7851c..aaf6af47cbfe 100644 --- a/code/modules/logging/log_holder.dm +++ b/code/modules/logging/log_holder.dm @@ -284,7 +284,13 @@ GENERAL_PROTECT_DATUM(/datum/log_holder) /datum/log_holder/proc/human_readable_timestamp(precision = 3) var/start = time2text(world.timeofday, "YYYY-MM-DD hh:mm:ss") // now we grab the millis from the rustg timestamp - var/list/timestamp = splittext(unix_timestamp_string(), ".") + var/rustg_stamp = unix_timestamp_string() + var/list/timestamp = splittext(rustg_stamp, ".") +#ifdef UNIT_TESTS + if(length(timestamp) != 2) + stack_trace("rustg returned illegally formatted string '[rustg_stamp]'") + return start +#endif var/millis = timestamp[2] if(length(millis) > precision) millis = copytext(millis, 1, precision + 1) diff --git a/code/modules/mapping/reader.dm b/code/modules/mapping/reader.dm index ca91c58847fb..b03177acfe13 100644 --- a/code/modules/mapping/reader.dm +++ b/code/modules/mapping/reader.dm @@ -347,6 +347,7 @@ // And we are done lads, call it off loading = FALSE SSatoms.map_loader_stop(REF(src)) + loading = FALSE if(new_z) for(var/z_index in bounds[MAP_MINZ] to bounds[MAP_MAXZ]) diff --git a/code/modules/mob/living/basic/guardian/guardian_types/protector.dm b/code/modules/mob/living/basic/guardian/guardian_types/protector.dm index a0aa34ad17f1..c923cad60c4a 100644 --- a/code/modules/mob/living/basic/guardian/guardian_types/protector.dm +++ b/code/modules/mob/living/basic/guardian/guardian_types/protector.dm @@ -16,7 +16,6 @@ /mob/living/basic/guardian/protector/Initialize(mapload, datum/guardian_fluff/theme) . = ..() shield = new(src) - shield.owner_has_control = FALSE // Hide it from the user, it's integrated with guardian UI shield.Grant(src) /mob/living/basic/guardian/protector/Destroy() @@ -49,6 +48,7 @@ background_icon_state = "base" cooldown_time = 1 SECONDS click_to_activate = FALSE + owner_has_control = FALSE // Hide it from the user, it's integrated with guardian UI /datum/action/cooldown/mob_cooldown/protector_shield/Activate(mob/living/target) if (!isliving(target)) diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 93d033da7f9b..1b98c758b55e 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -593,7 +593,7 @@ set_invis_see(min(glasses.invis_view, see_invisible)) if(!isnull(glasses.lighting_cutoff)) lighting_cutoff = max(lighting_cutoff, glasses.lighting_cutoff) - if(!isnull(glasses.color_cutoffs)) + if(length(glasses.color_cutoffs)) lighting_color_cutoffs = blend_cutoff_colors(lighting_color_cutoffs, glasses.color_cutoffs) diff --git a/code/modules/mob/living/carbon/death.dm b/code/modules/mob/living/carbon/death.dm index f2edcf670561..d75ed5450ae1 100644 --- a/code/modules/mob/living/carbon/death.dm +++ b/code/modules/mob/living/carbon/death.dm @@ -11,7 +11,7 @@ . = ..() - if(!gibbed) + if(!gibbed && !QDELING(src)) //double check they didn't start getting deleted in ..() attach_rot() for(var/T in get_traumas()) @@ -35,7 +35,7 @@ for(var/mob/M in src) M.forceMove(Tsec) visible_message(span_danger("[M] bursts out of [src]!")) - . = ..() + return ..() /mob/living/carbon/spill_organs(no_brain, no_organs, no_bodyparts) var/atom/Tsec = drop_location() diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index c4a7aa290892..c67ff29b4e13 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -281,7 +281,7 @@ var/datum/crime/citation/new_citation = new(name = citation_name, author = allowed_access, fine = fine) target_record.citations += new_citation - new_citation.alert_owner(target_record.name, "You have been fined [fine] credits for '[citation_name]'. Fines may be paid at security.") + new_citation.alert_owner(usr, src, target_record.name, "You have been fined [fine] credits for '[citation_name]'. Fines may be paid at security.") investigate_log("New Citation: [citation_name] Fine: [fine] | Added to [target_record.name] by [key_name(human_user)]", INVESTIGATE_RECORDS) SSblackbox.ReportCitation(REF(new_citation), human_user.ckey, human_user.real_name, target_record.name, citation_name, fine) diff --git a/code/modules/mob/living/living_movement.dm b/code/modules/mob/living/living_movement.dm index eeb9bceb5d5c..0da524effa61 100644 --- a/code/modules/mob/living/living_movement.dm +++ b/code/modules/mob/living/living_movement.dm @@ -12,7 +12,8 @@ // If we're moving to/from nullspace, refresh // Easier then adding nullchecks to all this shit, and technically right since a null turf means nograv if(isnull(old_turf) || isnull(new_turf)) - refresh_gravity() + if(!QDELING(src)) + refresh_gravity() return // If the turf gravity has changed, then it's possible that our state has changed, so update if(HAS_TRAIT(old_turf, TRAIT_FORCED_GRAVITY) != HAS_TRAIT(new_turf, TRAIT_FORCED_GRAVITY) || new_turf.force_no_gravity != old_turf.force_no_gravity)