Skip to content

Commit

Permalink
Merge pull request HearthOfHestia#198 from MarinaGryphon/bugfixes/11-…
Browse files Browse the repository at this point in the history
…26-2021
  • Loading branch information
noelle-lavenza authored Dec 4, 2021
2 parents 75b63e1 + 1788b41 commit 35611b4
Show file tree
Hide file tree
Showing 12 changed files with 53 additions and 40 deletions.
2 changes: 1 addition & 1 deletion code/__defines/flags.dm
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ The latter will result in a linter warning and will not work correctly.
#define ATOM_FLAG_ADJACENT_EXCEPTION BITFLAG(9) // Skips adjacent checks for atoms that should always be reachable in window tiles
#define ATOM_FLAG_NO_DISSOLVE BITFLAG(10) // Bypasses solvent reactions in the container.
#define ATOM_FLAG_NO_PHASE_CHANGE BITFLAG(11) // Bypasses heating and cooling product reactions in the container.
#define ATOM_FLAG_ALLOW_DIAGONAL_FACING BITFLAG(12) // Atom can face non-cardinal directions.
#define ATOM_FLAG_BLOCK_DIAGONAL_FACING BITFLAG(12) // Atom cannot face non-cardinal directions.

#define ATOM_IS_OPEN_CONTAINER(A) (A.atom_flags & ATOM_FLAG_OPEN_CONTAINER)

Expand Down
5 changes: 5 additions & 0 deletions code/_onclick/hud/radial.dm
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ var/global/list/radial_menus = list()
closeToolTip(usr)

/obj/screen/radial/slice/Click(location, control, params)
if(QDELETED(src) || QDELETED(parent))
return
if(parent && usr.client == parent.current_user)
if(next_page)
parent.next_page()
Expand All @@ -51,6 +53,8 @@ var/global/list/radial_menus = list()
icon_state = "radial_center"

/obj/screen/radial/center/Click(location, control, params)
if(QDELETED(src) || QDELETED(parent))
return
if(usr.client == parent.current_user)
parent.finished = TRUE

Expand Down Expand Up @@ -274,6 +278,7 @@ var/global/list/radial_menus = list()
/datum/radial_menu/proc/hide()
if(current_user)
current_user.images -= menu_holder
clear_vis_contents(menu_holder)

/datum/radial_menu/proc/wait(atom/user, atom/anchor, require_near = FALSE, list/check_locs)
while (current_user && !finished && !selected_choice)
Expand Down
2 changes: 1 addition & 1 deletion code/_onclick/hud/robot.dm
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ var/global/obj/screen/robot_inventory
else
//Modules display is hidden
//R.client.screen -= robot_inventory //"store" icon
for(var/atom/A in R.module.equipment)
for(var/atom/A in R.module?.equipment)
if( (A != R.module_state_1) && (A != R.module_state_2) && (A != R.module_state_3) )
//Module is not currently active
R.client.screen -= A
Expand Down
2 changes: 1 addition & 1 deletion code/datums/observation/dir_set.dm
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
/atom/set_dir(ndir)
var/old_dir = dir
// This attempts to mimic BYOND's handling of diagonal directions and cardinal icon states.
if(!(atom_flags & ATOM_FLAG_ALLOW_DIAGONAL_FACING) && !IsPowerOfTwo(ndir))
if((atom_flags & ATOM_FLAG_BLOCK_DIAGONAL_FACING) && !IsPowerOfTwo(ndir))
if(old_dir & ndir)
ndir = old_dir
else
Expand Down
13 changes: 7 additions & 6 deletions code/game/machinery/bodyscanner_console.dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/obj/machinery/body_scanconsole
var/obj/machinery/bodyscanner/connected
var/obj/machinery/bodyscanner/connected
var/stored_scan_subject
name = "Body Scanner Console"
icon = 'icons/obj/Cryogenic2.dmi'
Expand All @@ -20,7 +20,7 @@

/obj/machinery/body_scanconsole/on_update_icon()
if(stat & (BROKEN | NOPOWER))
icon_state = "body_scannerconsole-p"
icon_state = "body_scannerconsole-p"
else
icon_state = initial(icon_state)

Expand All @@ -31,13 +31,14 @@
break
events_repository.register(/decl/observ/destroyed, connected, src, .proc/unlink_scanner)

/obj/machinery/body_scanconsole/proc/unlink_scanner(var/obj/machinery/bodyscanner/scanner)
/obj/machinery/body_scanconsole/proc/unlink_scanner(var/obj/machinery/bodyscanner/scanner)
events_repository.unregister(/decl/observ/destroyed, scanner, src, .proc/unlink_scanner)
connected = null

/obj/machinery/body_scanconsole/proc/FindDisplays()
for(var/obj/machinery/body_scan_display/D in SSmachines.machinery)
if(D.tag in display_tags)
// TODO: Convert to use networking
if(D.id_tag in display_tags)
connected_displays += D
events_repository.register(/decl/observ/destroyed, D, src, .proc/remove_display)
return !!connected_displays.len
Expand Down Expand Up @@ -97,7 +98,7 @@
data["html_scan_header"] = display_medical_data_header(data["scan"], user.get_skill_value(SKILL_MEDICAL))
data["html_scan_health"] = display_medical_data_health(data["scan"], user.get_skill_value(SKILL_MEDICAL))
data["html_scan_body"] = display_medical_data_body(data["scan"], user.get_skill_value(SKILL_MEDICAL))

stored_scan_subject = connected.occupant
user.visible_message("<span class='notice'>\The [user] performs a scan of \the [connected.occupant] using \the [connected].</span>")
playsound(connected.loc, 'sound/machines/medbayscanner.ogg', 50)
Expand All @@ -111,7 +112,7 @@
new /obj/item/paper/bodyscan(loc, "Printout error.", "Body scan report - [stored_scan_subject]", scan.Copy())
return TOPIC_REFRESH

if(href_list["push"])
if(href_list["push"])
if(!connected_displays.len && !FindDisplays())
to_chat(user, "[html_icon(src)]<span class='warning'>Error: No configured displays detected.</span>")
return TOPIC_REFRESH
Expand Down
22 changes: 13 additions & 9 deletions code/modules/fabrication/_fabricator.dm
Original file line number Diff line number Diff line change
Expand Up @@ -128,15 +128,19 @@
if(length(installed_designs))
design_cache |= installed_designs

if(!known_tech)
known_tech = get_default_initial_tech_levels()
var/datum/extension/network_device/device = get_extension(src, /datum/extension/network_device)
var/datum/computer_network/network = device.get_network()
if(network)
for(var/obj/machinery/design_database/db in network.get_devices_by_type(/obj/machinery/design_database))
for(var/tech in db.tech_levels)
if(db.tech_levels[tech] > known_tech[tech])
known_tech[tech] = db.tech_levels[tech]
// This is necessary to prevent database consoles from overwriting the default tech levels.
var/list/default_tech = get_default_initial_tech_levels()
LAZYINITLIST(known_tech)
for(var/tech_key in known_tech)
known_tech[tech_key] = max(default_tech[tech_key], known_tech[tech_key])

var/datum/extension/network_device/device = get_extension(src, /datum/extension/network_device)
var/datum/computer_network/network = device.get_network()
if(network)
for(var/obj/machinery/design_database/db in network.get_devices_by_type(/obj/machinery/design_database))
for(var/tech in db.tech_levels)
if(db.tech_levels[tech] > known_tech[tech])
known_tech[tech] = db.tech_levels[tech]

var/list/unlocked_tech = SSfabrication.get_unlocked_recipes(fabricator_class, known_tech)
if(length(unlocked_tech))
Expand Down
2 changes: 1 addition & 1 deletion code/modules/materials/recipes_furniture.dm
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@
if(.)
for(var/obj/structure/window/check_window in user.loc)
if(check_window.is_fulltile())
to_chat(user, "<span class='warning'>There is already a fll-tile window here!</span>")
to_chat(user, SPAN_WARNING("There is already a full-tile window here!"))
return FALSE

/datum/stack_recipe/furniture/fullwindow/spawn_result(mob/user, location, amount)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mechs/mech.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
status_flags = PASSEMOTES
a_intent = I_HURT
mob_size = MOB_SIZE_LARGE
atom_flags = ATOM_FLAG_SHIELD_CONTENTS | ATOM_FLAG_NO_TEMP_CHANGE
atom_flags = ATOM_FLAG_SHIELD_CONTENTS | ATOM_FLAG_NO_TEMP_CHANGE | ATOM_FLAG_BLOCK_DIAGONAL_FACING

meat_type = null
meat_amount = 0
Expand Down
1 change: 1 addition & 0 deletions maps/torch/torch3_deck3.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -3330,6 +3330,7 @@
/area/hallway/primary/thirddeck/aft)
"hV" = (
/obj/effect/floor_decal/industrial/outline/grey,
/obj/machinery/design_database,
/turf/simulated/floor/bluegrid,
/area/tcommsat/chamber)
"hW" = (
Expand Down
2 changes: 1 addition & 1 deletion maps/torch/torch5_deck1.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -25602,7 +25602,7 @@
c_tag = "Infirmary - Operating Theatre 1";
dir = 1
},
/obj/machinery/fabricator/bioprinter,
/obj/machinery/fabricator/bioprinter/filled,
/turf/simulated/floor/tiled/white,
/area/medical/surgery)
"xxY" = (
Expand Down
5 changes: 4 additions & 1 deletion maps/torch/torch_presets.dm
Original file line number Diff line number Diff line change
Expand Up @@ -249,4 +249,7 @@ var/global/const/HAIL_FREQ = 1463
frequency = 1431

/obj/machinery/airlock_sensor/shuttle/opportunity
stock_part_presets = list(/decl/stock_part_preset/radio/basic_transmitter/airlock_sensor/shuttle/opportunity = 1)
stock_part_presets = list(/decl/stock_part_preset/radio/basic_transmitter/airlock_sensor/shuttle/opportunity = 1)

/obj/machinery/fabricator/bioprinter/filled
prefilled = TRUE
35 changes: 17 additions & 18 deletions mods/content/neural_laces/body_printer.dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#define MAX_PRINTING_PASSES 5
#define COST_PER_PRINT 15000 //in cm3
#define COST_PER_PRINT 15000 //in cm3
#define BIOPRINTER_MAX_MATERIALS 30000
#define MATERIAL_LOW 1
#define MATERIAL_VERY_LOW 2
Expand All @@ -12,7 +12,7 @@
icon_state = "base"
density = TRUE
anchored = TRUE
idle_power_usage = 200
idle_power_usage = 200
active_power_usage = 15 KILOWATTS
stat_immune = 0

Expand Down Expand Up @@ -45,16 +45,16 @@

var/increment_delay //The time between y increments for the alpha masking of the mob icon and the print head. This is based on the printing time, hence why it is configurable.
var/next_increment = 0
var/total_passes = 0
var/total_passes = 0
var/obj/item/disk/dna/diskette
var/datum/sound_token/sound_token
var/sound_id

var/list/materials = list(/decl/material/solid/meat = 0, /decl/material/solid/bone = 0)

var/list/technobabble_systems = list(
"microservo positioning system",
"flash-sterilization subsystem",
"microservo positioning system",
"flash-sterilization subsystem",
"flash-differentiation feed system",
"print laser power regulation system",
"biomass circulation subsystem",
Expand Down Expand Up @@ -151,7 +151,8 @@
D.forceMove(src)
diskette = D
to_chat(user, SPAN_NOTICE("You insert \the [D] into \the [src]."))
if(I.matter[1] in materials)
return TRUE
if(isitem(I) && LAZYLEN(I.matter) && (I.matter[1] in materials))
accept_materials(I, user)

/obj/machinery/bioprinter/proc/accept_materials(var/obj/item/S, var/user)
Expand All @@ -162,7 +163,7 @@

if(materials[S.matter[1]] == BIOPRINTER_MAX_MATERIALS)
to_chat(user, SPAN_WARNING("\The [src] is full of [S]!"))
return
return
if(isstack(S))
var/obj/item/stack/ST = S
var/sheets_input = input(user, "How many sheets do you wish to input?", "Sheet Input", 0) as num|null
Expand All @@ -173,16 +174,14 @@
sheets_input = clamp(sheets_input, 1, ST.amount)

var/free_space = BIOPRINTER_MAX_MATERIALS - materials[ST.matter[1]]

if(free_space == 0)
to_chat(user, SPAN_WARNING("\The [src] is full of [ST]!"))
return

var/max_input = round((free_space / SHEET_MATERIAL_AMOUNT))
if(max_input == 0)
to_chat(user, SPAN_WARNING("\The [src] is too full to add \the [ST]!"))
return

sheets_input = min(sheets_input, max_input)
var/input_amt = sheets_input * SHEET_MATERIAL_AMOUNT

var/input_amt = sheets_input * SHEET_MATERIAL_AMOUNT

if((materials[ST.matter[1]] + input_amt) >= BIOPRINTER_MAX_MATERIALS) //doublecheck sanity
return
Expand Down Expand Up @@ -218,7 +217,7 @@
materials[material1] -= mat1amt
materials[material2] -= mat2amt
return TRUE

/obj/machinery/bioprinter/proc/open_pod_start()
animate(lid, pixel_y = 38, time = 3 SECONDS, easing = SINE_EASING)
addtimer(CALLBACK(src, .proc/open_pod_finish), 3 SECONDS)
Expand Down Expand Up @@ -269,7 +268,7 @@
add_overlay(image(icon, "reactor_low"))
if(MATERIAL_FULL)
add_overlay(image(icon, "reactor_full"))

if(!printing && !cleaning)
add_overlay(image(icon, "computer_standby"))
if(printing && !needs_attention)
Expand Down Expand Up @@ -333,7 +332,7 @@
.["start_print"] = cached_choices["start_print"]
if(needs_attention)
.["interact"] = cached_choices["interact"]


/obj/machinery/bioprinter/proc/get_printing_increment()
. = round((printing_time / MAX_PRINTING_PASSES))
Expand Down Expand Up @@ -462,7 +461,7 @@

/obj/machinery/bioprinter/proc/do_fakemob_animation(var/fakemob_name, var/filter_name, var/stage_name, var/fakemob_layer_increment, var/fade_out = FALSE)
var/obj/structure/fake_clone_mob/fakemob = clone_mobs[fakemob_name]

if(!fakemob)
return

Expand Down

0 comments on commit 35611b4

Please sign in to comment.