Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Local catgirl fixes another batch of minor issues #3920

Merged
merged 15 commits into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions code/datums/wires/_wires.dm
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,12 @@

/datum/wires/Destroy()
holder = null
assemblies = list()
//properly clear refs to avoid harddels & other problems
for(var/color in assemblies)
var/obj/item/assembly/assembly = assemblies[color]
assembly.holder = null
assembly.connected = null
LAZYCLEARLIST(assemblies)
return ..()

/datum/wires/proc/add_duds(duds)
Expand Down Expand Up @@ -186,6 +191,14 @@
if(S && istype(S) && S.attachable && !is_attached(color))
assemblies[color] = S
S.forceMove(holder)
/**
* special snowflake check for machines
* someone attached a signaler to the machines wires
* move it to the machines component parts so it doesn't get moved out in dump_inventory_contents() which gets called a lot
*/
if(istype(holder, /obj/machinery))
var/obj/machinery/machine = holder
LAZYADD(machine.component_parts, S)
S.connected = src
S.on_attach() // Notify assembly that it is attached
return S
Expand All @@ -195,7 +208,6 @@
if(S && istype(S))
assemblies -= color
S.on_detach() // Notify the assembly. This should remove the reference to our holder
S.forceMove(holder.drop_location())
return S

/// Called from [/atom/proc/emp_act]
Expand Down
2 changes: 1 addition & 1 deletion code/datums/wounds/_wounds.dm
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@
/datum/wound/proc/handle_process(seconds_per_tick, times_fired)
SHOULD_CALL_PARENT(TRUE)
if(regen_ticks_current > regen_ticks_needed)
if(!victim || !limb)
if(QDELETED(victim) || QDELETED(limb))
qdel(src)
return
to_chat(victim, span_green("Your [limb.plaintext_zone] has recovered from its [undiagnosed_name || name]!"))
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/mail.dm
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@
goodies[quirk_goodie] = 5

for(var/iterator in 1 to goodie_count)
var/target_good = pick_weight(goodies)
var/target_good = pick_weight(fill_with_ones(goodies)) // monkestation edit: fix pick_weight runtime
var/atom/movable/target_atom = new target_good(src)
body.log_message("received [target_atom.name] in the mail ([target_good])", LOG_GAME)

Expand Down
21 changes: 10 additions & 11 deletions code/game/objects/items/rcd/RCD.dm
Original file line number Diff line number Diff line change
Expand Up @@ -289,20 +289,19 @@ GLOBAL_VAR_INIT(icon_holographic_window, init_holographic_window())
var/list/structures_to_ignore
if(istype(target, /obj/structure/grille))
if(is_full_tile) //if we are trying to build full-tile windows we ignore the grille
structures_to_ignore = list(target)
else //no building directional windows on grills
return FALSE
else //for directional windows we ignore other directional windows as they can be in diffrent directions on the turf.
structures_to_ignore = list(/obj/structure/grille, /obj/structure/grille/window_sill) // monkestation edit: add /obj/structure/grille/window_sill subtype
else //when building directional windows we ignore the grill and other directional windows
structures_to_ignore = list(/obj/structure/grille, /obj/structure/window)
else //for directional windows we ignore other directional windows as they can be in different directions on the turf.
structures_to_ignore = list(/obj/structure/window)
//if we are trying to build full-tile windows we only ignore the grille but other directional windows on the grill can block its construction
if(window_type == /obj/structure/window/fulltile || window_type == /obj/structure/window/reinforced/fulltile)
structures_to_ignore = list(/obj/structure/grille, /obj/structure/window_sill)
//for normal directional windows we ignore the grille & other directional windows as they can be in diffrent directions on the grill. There is a later check during construction to deal with those
else
structures_to_ignore = list(/obj/structure/grille, /obj/structure/window, /obj/structure/window_sill)

// monkestation start: window sills
if(is_full_tile)
structures_to_ignore += /obj/structure/window_sill
// monkestation end

//check if we can build our window on the grill
if(target_turf.is_blocked_turf(exclude_mobs = !is_full_tile, source_atom = null, ignore_atoms = structures_to_ignore, type_list = !is_full_tile))
if(target_turf.is_blocked_turf(exclude_mobs = !is_full_tile, source_atom = null, ignore_atoms = structures_to_ignore, type_list = TRUE))
playsound(loc, 'sound/machines/click.ogg', 50, TRUE)
balloon_alert(user, "something is blocking the turf")
return FALSE
Expand Down
2 changes: 1 addition & 1 deletion code/modules/assembly/holder.dm
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@

/obj/item/assembly_holder/proc/try_add_assembly(obj/item/assembly/attached_assembly, mob/user)
if(attached_assembly.secured)
balloon_alert(attached_assembly, "not attachable!")
balloon_alert(user, "not attachable!")
return FALSE

if(LAZYLEN(assemblies) >= HOLDER_MAX_ASSEMBLIES)
Expand Down
2 changes: 2 additions & 0 deletions code/modules/asset_cache/assets/rcd.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
'icons/obj/smooth_structures/catwalk.dmi' = list("catwalk-0"),
'icons/hud/radial.dmi' = list("cnorth", "csouth", "ceast", "cwest", "chair", "secure_windoor", "stool", "wallfloor", "windowsize", "windowtype", "windoor"),
'icons/obj/structures.dmi' = list("glass_table", "rack", "rwindow0", "reflector_base", "table", "window0", "girder"),
// monkestation edit: window sills
'monkestation/icons/obj/structures/window/window_sill.dmi' = list("window_sill-0"),
)

var/icon/icon
Expand Down
8 changes: 4 additions & 4 deletions code/modules/reagents/reagent_containers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@
. = TRUE

/obj/item/reagent_containers/proc/SplashReagents(atom/target, thrown = FALSE, override_spillable = FALSE)
if(!reagents || !reagents.total_volume || (!spillable && !override_spillable))
if(!reagents?.total_volume || (!spillable && !override_spillable))
return
var/mob/thrown_by = thrownby?.resolve()

Expand Down Expand Up @@ -279,7 +279,7 @@
if(istype(T, /turf/open))
T.add_liquid_from_reagents(reagents, FALSE, reagents.chem_temp)

if(reagents.reagent_list.len && thrown_by)
if(length(reagents.reagent_list) && thrown_by)
log_combat(thrown_by, target, "splashed (thrown) [english_list(reagents.reagent_list)]", "in [AREACOORD(target)]")
log_game("[key_name(thrown_by)] splashed (thrown) [english_list(reagents.reagent_list)] on [target] in [AREACOORD(target)].")
message_admins("[ADMIN_LOOKUPFLW(thrown_by)] splashed (thrown) [english_list(reagents.reagent_list)] on [target] in [ADMIN_VERBOSEJMP(target)].")
Expand All @@ -289,12 +289,12 @@
if(istype(targets_loc, /turf/open))
if(thrown_by && !target.can_atmos_pass)
var/turf/open/open = get_step(src, get_dir(src, thrown_by))
open.add_liquid_from_reagents(reagents)
open?.add_liquid_from_reagents(reagents)
else
targets_loc.add_liquid_from_reagents(reagents)
else
targets_loc = get_step_towards(targets_loc, thrown_by)
targets_loc.add_liquid_from_reagents(reagents) //not perfect but i can't figure out how to move something to the nearest visible turf from throw_target
targets_loc?.add_liquid_from_reagents(reagents) //not perfect but i can't figure out how to move something to the nearest visible turf from throw_target
reagents.expose(target, TOUCH)
if(QDELETED(src))
return
Expand Down
18 changes: 9 additions & 9 deletions code/modules/reagents/reagent_containers/blood_pack.dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@
blood_type = null

var/datum/reagent/master_reagent = holder.get_master_reagent()
if(istype(master_reagent, /datum/reagent/blood))
blood_type = master_reagent.data?["blood_type"]

else
for(var/blood_type in GLOB.blood_types)
var/datum/blood_type/blood = GLOB.blood_types[blood_type]
if(blood.reagent_type == master_reagent.type)
blood_type = blood_type
break
if(master_reagent)
if(istype(master_reagent, /datum/reagent/blood))
blood_type = master_reagent.data?["blood_type"]
else
for(var/blood_type in GLOB.blood_types)
var/datum/blood_type/blood = GLOB.blood_types[blood_type]
if(blood.reagent_type == master_reagent.type)
blood_type = blood_type
break

return ..()

Expand Down
32 changes: 29 additions & 3 deletions monkestation/code/modules/aesthetics/objects/window_sill.dm
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,39 @@
return TOOL_ACT_TOOLTYPE_SUCCESS

/obj/structure/window_sill/deconstruct(disassembled = TRUE, wrench_disassembly = 0)
new /obj/item/stack/sheet/iron(get_turf(src))
new /obj/item/stack/sheet/iron(drop_location())
qdel(src)

/obj/structure/window_sill/rcd_vals(mob/user, obj/item/construction/rcd/the_rcd)
if(!isturf(loc) || the_rcd.mode != RCD_WINDOWGRILLE)
return FALSE
var/obj/structure/grille/existing_grille = locate() in loc
if(existing_grille)
return existing_grille.rcd_vals(user, the_rcd)
return rcd_result_with_memory(
list("mode" = RCD_WINDOWGRILLE, "delay" = 1 SECONDS, "cost" = 4),
loc, RCD_MEMORY_WINDOWGRILLE,
)

/obj/structure/window_sill/rcd_act(mob/user, obj/item/construction/rcd/the_rcd, passed_mode)
if(!isturf(loc) || passed_mode != RCD_WINDOWGRILLE)
return FALSE
var/obj/structure/window/window_path = the_rcd.window_type
if(!ispath(window_path))
CRASH("Invalid window path type in RCD: [window_path]")
if(!window_path::fulltile)
return FALSE
var/obj/structure/grille/existing_grille = locate() in loc
if(!existing_grille)
var/obj/structure/grille/window_sill/new_grille = new(loc)
new_grille.set_anchored(TRUE)
return TRUE
return existing_grille.rcd_act(user, the_rcd, passed_mode)

/obj/structure/window_sill/attackby(obj/item/attacking_item, mob/user, params)
. = ..()
if(!isstack(attacking_item))
return FALSE
if(!. || !isstack(attacking_item))
return
var/obj/item/stack/stack_item = attacking_item
if(istype(attacking_item, /obj/item/stack/sheet/glass))
if(stack_item.amount < 2)
Expand Down
2 changes: 2 additions & 0 deletions monkestation/code/modules/antagonists/brother/brother.dm
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@
var/formatted_msg = "<span class='[team.color]'><b><i>\[Blood Bond\]</i> [span_name("[owner.name]")]</b>: [message]</span>"
for(var/datum/mind/brother as anything in team.members)
var/mob/living/target = brother.current
if(QDELETED(target))
continue
if(brother != owner)
target.balloon_alert(target, "you hear a voice")
target.playsound_local(get_turf(target), 'goon/sounds/radio_ai.ogg', vol = 25, vary = FALSE, pressure_affected = FALSE, use_reverb = FALSE)
Expand Down
15 changes: 8 additions & 7 deletions monkestation/code/modules/blood_datum/elements/easy_ignite.dm
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@

/datum/element/easy_ignite/Detach(datum/source, ...)
. = ..()
UnregisterSignal(source, COMSIG_ATOM_ATTACKBY)
UnregisterSignal(source, COMSIG_ATOM_FIRE_ACT)
UnregisterSignal(source, COMSIG_ATOM_BULLET_ACT)
UnregisterSignal(source, COMSIG_ATOM_TOOL_ACT(TOOL_WELDER))
if(isturf(source))
UnregisterSignal(source, COMSIG_TURF_EXPOSE)
UnregisterSignal(source, list(
COMSIG_ATOM_ATTACKBY,
COMSIG_ATOM_FIRE_ACT,
COMSIG_ATOM_BULLET_ACT,
COMSIG_ATOM_TOOL_ACT(TOOL_WELDER),
COMSIG_TURF_EXPOSE
))

/datum/element/easy_ignite/proc/ignite(atom/igniting, mob/user)
var/delete_after = TRUE
Expand Down Expand Up @@ -61,7 +62,7 @@
if(exposed_temperature > required_temp)
ignite(source)

/datum/element/easy_ignite/proc/attackby_react(obj/item/source, mob/user, obj/item/tool, modifiers)
/datum/element/easy_ignite/proc/attackby_react(obj/item/source, obj/item/tool, mob/user, modifiers)
SIGNAL_HANDLER

if(tool.get_temperature() && item_ignition(source, tool, user))
Expand Down
3 changes: 2 additions & 1 deletion monkestation/code/modules/blueshift/wounds/muscle_wounds.dm
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@
return ..()

/datum/wound/muscle/handle_process()
if(QDELETED(victim) || QDELETED(limb))
return
. = ..()

regen_ticks_current++
if(victim.body_position == LYING_DOWN)
if(prob(50))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
. = ..()
src.board_size = board_size

/datum/hacking_minigame/Destroy(force)
QDEL_LIST(board)
return ..()

/**
* checks if the game is finished
*
Expand Down Expand Up @@ -261,6 +265,10 @@
. = ..()
game = _game

/datum/hacking_minigame_piece/Destroy(force)
game = null
return ..()

///Returns value of pass_in + pass_out
/datum/hacking_minigame_piece/proc/get_dir_val()
if(pass_in != NONE && pass_out != NONE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
var/amount
///Callback interaction called when the turf has some liquids on it
var/datum/callback/pre_secrete_callback
var/next_secrete = 0
COOLDOWN_DECLARE(next_secrete)

/datum/component/liquid_secretion/Initialize(reagent_id = /datum/reagent/water, amount = 10, secretion_interval = 1 SECONDS, pre_secrete_callback)
. = ..()
Expand Down Expand Up @@ -40,14 +40,13 @@


/datum/component/liquid_secretion/process(seconds_per_tick)
if(!parent || (next_secrete > world.time))
if(QDELETED(parent) || !COOLDOWN_FINISHED(src, next_secrete))
return
next_secrete = world.time + secretion_interval
COOLDOWN_START(src, next_secrete, secretion_interval)
if(pre_secrete_callback && !pre_secrete_callback.Invoke(parent))
return

var/turf/parent_turf = get_turf(parent)
var/list/reagent_list = list()
reagent_list |= reagent_id
reagent_list[reagent_id] = amount
parent_turf.add_liquid_list(reagent_list, FALSE, T20C)
parent_turf?.add_liquid_list(reagent_list, FALSE, T20C)
3 changes: 1 addition & 2 deletions monkestation/code/modules/smithing/oozelings/body/organs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -339,8 +339,7 @@

if(HAS_TRAIT(slime, TRAIT_BLOOD_DEFICIENCY))
var/datum/quirk/blooddeficiency/blooddeficiency = slime.get_quirk(/datum/quirk/blooddeficiency)
if(!isnull(blooddeficiency))
blooddeficiency.lose_blood(seconds_per_tick)
blooddeficiency?.lose_blood(slime, seconds_per_tick)

if(slime.blood_volume < BLOOD_VOLUME_OKAY)
if(SPT_PROB(2.5, seconds_per_tick))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
generate_sequence()

/datum/cracker_puzzle/Destroy(force)
. = ..()
parent = null
return ..()

/datum/cracker_puzzle/proc/generate_combination_strings()
combinations = list()
Expand Down Expand Up @@ -136,7 +136,6 @@

/datum/cracker_puzzle/ui_interact(mob/user, datum/tgui/ui)
. = ..()

ui = SStgui.try_update_ui(user, src, ui)
if(!ui)
ui = new(user, src, "CrackerPuzzle", "Genetic Sequence")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@
UnregisterSignal(parent, COMSIG_ATOM_EXTRAPOLATOR_ACT)

/datum/component/symptom_genes/Destroy(force)
. = ..()
current_user = null
current_extrapolator = null
if(puzzle)
SStgui.close_uis(puzzle)
UnregisterSignal(puzzle, list(COMSIG_CRACKER_PUZZLE_FAILURE, COMSIG_CRACKER_PUZZLE_SUCCESS))
qdel(puzzle)
QDEL_NULL(puzzle)
return ..()

/datum/component/symptom_genes/proc/add_symptoms(datum/species/host_species, symptom_count)

Expand Down
Loading