From cc9b4dec204d44f221fe23b48e766b3a9cc661ae Mon Sep 17 00:00:00 2001 From: Drathek <76988376+Drulikar@users.noreply.github.com> Date: Thu, 2 Jan 2025 14:58:46 -0600 Subject: [PATCH] Proc Redefinition Linting (#7862) # About the pull request This PR turns on redefinition warnings (which should fail lints since we Werror). This PR needs testing though as there are going to be actual changes from this refactor. One aspect for example I'm not sure about is whether an area power_change should just always update_icon (vendor code mistakenly was causing this). I have opted to just include that in the proc now and removed redundant calls. Another couple notable example are that `repair_robotic_organs` now has an implementation for `repeat_step_criteria` and `pkd_special` revolvers that aren't a `l_series` subtype will no longer have burst changes. TGS DMAPI also fails this, but I am waiting advice on what to do about this, so for now it will serve just as a test to ensure lints fail. See https://github.com/tgstation/tgstation-server/issues/2056 (This is now fixed) # Explain why it's good for the game In almost all cases, a redefinition is not necessary. And in the few cases it is, `CAN_BE_REDEFINED(TRUE)` can be used for the proc. See code changes for examples of all the obvious mistakes allowing redefinitions has caused. # Testing Photographs and Procedure
Screenshots & Videos Put screenshots and videos here with an empty line between the screenshots and the `
` tags.
# Changelog :cl: Drathek balance: The PKD special burst values have changed for non-"Double" (l_series) variants code: Code no longer uses proc redefinitions with a few exceptions for global macros fix: Fixed various things like all backpacks (instead of just JIMA flags) processing /:cl: --- SpacemanDMM.toml | 1 + code/__DEFINES/MC.dm | 2 +- code/__DEFINES/__spacemandmm.dm | 2 + code/__DEFINES/_globals.dm | 2 + code/_onclick/ai.dm | 50 ------------------- code/_onclick/click.dm | 45 +++++++++++++++-- code/_onclick/click_hold.dm | 1 + code/_onclick/item_attack.dm | 2 +- code/controllers/subsystem/nanoui.dm | 4 +- .../diseases/advance/symptoms/weight.dm | 2 +- code/datums/effects/mob_crit/crit.dm | 2 +- code/datums/emergency_calls/upp_commando.dm | 2 +- code/datums/entities/player.dm | 19 +++++++ code/game/area/Sulaco.dm | 21 ++++---- code/game/gamemodes/extended/extended.dm | 2 +- code/game/jobs/whitelist.dm | 8 --- code/game/machinery/OpTable.dm | 4 -- code/game/machinery/air_alarm.dm | 18 ++----- code/game/machinery/computer/computer.dm | 7 --- .../machinery/computer/dropship_weapons.dm | 24 ++++----- code/game/machinery/cryo.dm | 8 +-- .../machinery/door_display/door_display.dm | 11 ---- code/game/machinery/doors/airlock.dm | 9 ++-- code/game/machinery/doors/airlock_control.dm | 9 ---- code/game/machinery/doors/brig_system.dm | 5 -- .../doors/poddoor/shutters/shutters.dm | 3 -- code/game/machinery/doors/railing.dm | 2 +- code/game/machinery/fax_machine.dm | 25 ++++------ code/game/machinery/fire_alarm.dm | 41 +++++++-------- code/game/machinery/fuelcell_recycler.dm | 4 -- code/game/machinery/holosign.dm | 6 ++- code/game/machinery/igniter.dm | 1 - code/game/machinery/kitchen/microwave.dm | 5 -- code/game/machinery/kitchen/smartfridge.dm | 4 +- code/game/machinery/lightswitch.dm | 5 +- code/game/machinery/machinery.dm | 5 +- .../game/machinery/medical_pod/bodyscanner.dm | 10 ++-- code/game/machinery/recharger.dm | 4 -- code/game/machinery/sentry_holder.dm | 5 -- code/game/machinery/suit_storage_unit.dm | 6 +-- code/game/machinery/telecomms/presets.dm | 24 ++++----- code/game/machinery/teleporter.dm | 9 ++-- code/game/machinery/vending/cm_vending.dm | 5 -- code/game/machinery/vending/vending.dm | 7 --- .../vending/vendor_types/crew/vehicle_crew.dm | 13 ++--- code/game/objects/items/backpack_sprayers.dm | 11 +--- code/game/objects/items/cprbot_item.dm | 29 ----------- .../objects/items/devices/motion_detector.dm | 15 +++--- code/game/objects/items/implants/implant.dm | 5 +- code/game/objects/items/implants/implanter.dm | 11 ++-- .../reagent_containers/food/condiment.dm | 5 +- .../items/reagent_containers/food/snacks.dm | 50 ++++++++++++------- .../reagent_containers/food/snacks/grown.dm | 12 ----- code/game/objects/items/storage/boxes.dm | 2 +- .../game/objects/items/tools/kitchen_tools.dm | 2 +- code/game/objects/items/weapons/weapon.dm | 2 +- code/game/objects/objs.dm | 9 ---- .../crates_lockers/closets/phonebox.dm | 2 +- .../objects/structures/pipes/trinary_misc.dm | 4 +- .../structures/props/requests_console.dm | 4 -- .../objects/structures/reagent_dispensers.dm | 12 ----- .../structures/stool_bed_chair_nest/bed.dm | 3 +- .../structures/stool_bed_chair_nest/chairs.dm | 7 ++- code/game/turfs/floor.dm | 2 +- code/game/turfs/floor_types.dm | 6 +++ code/game/turfs/hybrisa.dm | 3 ++ code/game/turfs/turf.dm | 8 +++ code/modules/almayer/machinery.dm | 4 -- code/modules/assembly/holder.dm | 39 +++++++-------- code/modules/assembly/infrared.dm | 12 ++--- code/modules/clans/client.dm | 19 ------- code/modules/client/client_procs.dm | 4 ++ code/modules/client/country_flags.dm | 6 --- code/modules/clothing/clothing.dm | 17 ++++++- code/modules/clothing/clothing_accessories.dm | 20 -------- code/modules/clothing/head/helmet.dm | 13 ++--- code/modules/cm_aliens/structures/trap.dm | 13 ++--- code/modules/cm_marines/Donator_Items.dm | 2 +- code/modules/cm_marines/anti_air.dm | 11 ++-- code/modules/cm_marines/orbital_cannon.dm | 2 +- code/modules/cm_marines/smartgun_mount.dm | 5 +- code/modules/cm_tech/implements/armor.dm | 6 +-- code/modules/cm_tech/trees/marine.dm | 22 -------- code/modules/defenses/defenses.dm | 16 +++--- code/modules/defenses/planted_flag.dm | 3 +- .../desert_dam/filtration/structures.dm | 6 +++ .../desert_dam/motion_sensor/sensortower.dm | 4 -- code/modules/gear_presets/colonist.dm | 2 +- code/modules/gear_presets/corpses.dm | 2 +- code/modules/gear_presets/synths.dm | 9 +--- code/modules/gear_presets/uscm_forecon.dm | 10 ++-- .../lighting/lighting_mask/lighting_mask.dm | 22 ++++++++ .../lighting_mask/shadow_calculator.dm | 26 ---------- code/modules/lighting/lighting_turf.dm | 11 ---- .../living/carbon/human/human_abilities.dm | 2 +- code/modules/mob/logout.dm | 1 + code/modules/mob/mob.dm | 20 ++++---- code/modules/organs/limbs.dm | 11 ---- code/modules/power/apc.dm | 19 ++++--- code/modules/power/power.dm | 7 +-- code/modules/projectiles/gun_attachables.dm | 2 +- code/modules/projectiles/guns/lever_action.dm | 28 +---------- code/modules/projectiles/guns/revolvers.dm | 2 +- .../chemistry_machinery/chem_master.dm | 5 -- code/modules/recycling/recycler.dm | 4 -- code/modules/shuttle/shuttles/dropship.dm | 22 ++------ .../surgery/robotic_organs_internal.dm | 2 +- code/modules/tgui/tgui-say/typing.dm | 4 -- .../hardpoints/secondary/grenade_launcher.dm | 4 -- .../vehicles/multitile/multitile_bump.dm | 6 --- code/modules/vehicles/van/box_van.dm | 11 ++-- code/modules/vehicles/van/van.dm | 11 ++-- code/modules/vehicles/vehicle.dm | 3 -- 113 files changed, 378 insertions(+), 740 deletions(-) diff --git a/SpacemanDMM.toml b/SpacemanDMM.toml index 0286023701d4..970cfb9cc646 100644 --- a/SpacemanDMM.toml +++ b/SpacemanDMM.toml @@ -13,3 +13,4 @@ engine = "auxtools" [diagnostics] var_in_proc_parameter = "error" +redefined_proc = "warning" diff --git a/code/__DEFINES/MC.dm b/code/__DEFINES/MC.dm index 7ce6fe06783a..8497791d5cce 100644 --- a/code/__DEFINES/MC.dm +++ b/code/__DEFINES/MC.dm @@ -118,7 +118,7 @@ NEW_SS_GLOBAL(SS##X);\ PreInit();\ }\ -/datum/controller/subsystem/processing/##X/fire() {..() /*just so it shows up on the profiler*/} \ +/datum/controller/subsystem/processing/##X/fire() {CAN_BE_REDEFINED(TRUE); ..() /*just so it shows up on the profiler*/} \ /datum/controller/subsystem/processing/##X #define log_qdel(X) log_debug(X) diff --git a/code/__DEFINES/__spacemandmm.dm b/code/__DEFINES/__spacemandmm.dm index 9a044949db3e..6b9ae12bb5fe 100644 --- a/code/__DEFINES/__spacemandmm.dm +++ b/code/__DEFINES/__spacemandmm.dm @@ -11,6 +11,7 @@ #define SHOULD_BE_PURE(X) set SpacemanDMM_should_be_pure = X #define PRIVATE_PROC(X) set SpacemanDMM_private_proc = X #define PROTECTED_PROC(X) set SpacemanDMM_protected_proc = X + #define CAN_BE_REDEFINED(X) set SpacemanDMM_can_be_redefined = X #define VAR_FINAL var/SpacemanDMM_final #define VAR_PRIVATE var/SpacemanDMM_private #define VAR_PROTECTED var/SpacemanDMM_protected @@ -23,6 +24,7 @@ #define SHOULD_BE_PURE(X) #define PRIVATE_PROC(X) #define PROTECTED_PROC(X) + #define CAN_BE_REDEFINED(X) #define VAR_FINAL var #define VAR_PRIVATE var #define VAR_PROTECTED var diff --git a/code/__DEFINES/_globals.dm b/code/__DEFINES/_globals.dm index 012f8d96d27d..5ba691311ed0 100644 --- a/code/__DEFINES/_globals.dm +++ b/code/__DEFINES/_globals.dm @@ -35,6 +35,7 @@ #ifndef TESTING #define GLOBAL_PROTECT(X)\ /datum/controller/global_vars/InitGlobal##X(){\ + CAN_BE_REDEFINED(TRUE);\ ..();\ gvars_datum_protected_varlist[#X] = TRUE;\ } @@ -44,6 +45,7 @@ #define GLOBAL_SORTED(X)\ /datum/controller/global_vars/InitGlobal##X(){\ + CAN_BE_REDEFINED(TRUE);\ ..();\ ##X = sortAssoc(##X);\ } diff --git a/code/_onclick/ai.dm b/code/_onclick/ai.dm index f2ce05481f9b..6c11a073e274 100644 --- a/code/_onclick/ai.dm +++ b/code/_onclick/ai.dm @@ -1,43 +1,3 @@ -/* - AI ClickOn() - - Note currently ai is_mob_restrained() returns 0 in all cases, - therefore restrained code has been removed - - The AI can double click to move the camera (this was already true but is cleaner), - or double click a mob to track them. - - Note that AI have no need for the adjacency proc, and so this proc is a lot cleaner. -*/ - -/mob/click(atom/A, list/mods) - ..() - - if(!client || !client.remote_control) - return FALSE - - if (mods["middle"]) - A.AIMiddleClick(src) - return 1 - - if (mods["shift"]) - A.AIShiftClick(src) - return 1 - - if (mods["alt"]) - A.AIAltClick(src) - return 1 - - if (mods["ctrl"]) - A.AICtrlClick(src) - return 1 - - if (world.time <= next_move) - return 1 - - A.attack_remote(src) - return 1 - /* AI has no need for the UnarmedAttack() and RangedAttack() procs, because the AI code is not generic; attack_remote() is used instead. @@ -49,16 +9,6 @@ /mob/living/silicon/ai/RangedAttack(atom/A) A.attack_remote(src) -/mob/UnarmedAttack(atom/A) - if(!client || !client.remote_control) - return FALSE - A.attack_remote(src) - -/mob/RangedAttack(atom/A) - if(!client || !client.remote_control) - return FALSE - A.attack_remote(src) - /atom/proc/attack_remote(mob/user as mob) return diff --git a/code/_onclick/click.dm b/code/_onclick/click.dm index 6bde28d35c09..93ed8dbf4f49 100644 --- a/code/_onclick/click.dm +++ b/code/_onclick/click.dm @@ -192,8 +192,43 @@ * mob/RangedAttack(atom,params) - used only ranged, only used for tk and laser eyes but could be changed */ +/* + AI ClickOn() + + Note currently ai is_mob_restrained() returns 0 in all cases, + therefore restrained code has been removed + + The AI can double click to move the camera (this was already true but is cleaner), + or double click a mob to track them. + + Note that AI have no need for the adjacency proc, and so this proc is a lot cleaner. +*/ + /mob/proc/click(atom/A, list/mods) - return FALSE + if(!client || !client.remote_control) + return FALSE + + if(mods["middle"]) + A.AIMiddleClick(src) + return TRUE + + if(mods["shift"]) + A.AIShiftClick(src) + return TRUE + + if(mods["alt"]) + A.AIAltClick(src) + return TRUE + + if(mods["ctrl"]) + A.AICtrlClick(src) + return TRUE + + if(world.time <= next_move) + return TRUE + + A.attack_remote(src) + return TRUE /atom/proc/clicked(mob/user, list/mods) if (mods["shift"] && !mods["middle"]) @@ -230,7 +265,9 @@ in human click code to allow glove touches only at melee range. */ /mob/proc/UnarmedAttack(atom/A, proximity_flag, click_parameters) - return + if(!client || !client.remote_control) + return FALSE + A.attack_remote(src) /* Ranged unarmed attack: @@ -241,7 +278,9 @@ animals lunging, etc. */ /mob/proc/RangedAttack(atom/A, params) - return + if(!client || !client.remote_control) + return FALSE + A.attack_remote(src) /* Restrained ClickOn diff --git a/code/_onclick/click_hold.dm b/code/_onclick/click_hold.dm index 1d6c25619e5e..4b2d60939ea8 100644 --- a/code/_onclick/click_hold.dm +++ b/code/_onclick/click_hold.dm @@ -14,6 +14,7 @@ /// The history of all atoms that were hovered over while the mouse was depressed var/list/mouse_trace_history var/list/lmb_last_mousedown_mods + var/datum/entity/clan_player/clan_info /client/MouseDown(atom/A, turf/T, skin_ctl, params) ignore_next_click = FALSE diff --git a/code/_onclick/item_attack.dm b/code/_onclick/item_attack.dm index 5905bb7c3582..818937ff16a0 100644 --- a/code/_onclick/item_attack.dm +++ b/code/_onclick/item_attack.dm @@ -9,7 +9,7 @@ dig_out_shrapnel(user) // No comment -/atom/proc/attackby(obj/item/W, mob/living/user,list/mods) +/atom/proc/attackby(obj/item/W, mob/living/user, list/mods) if(SEND_SIGNAL(src, COMSIG_PARENT_ATTACKBY, W, user, mods) & COMPONENT_NO_AFTERATTACK) return TRUE SEND_SIGNAL(user, COMSIG_MOB_PARENT_ATTACKBY, src, W) diff --git a/code/controllers/subsystem/nanoui.dm b/code/controllers/subsystem/nanoui.dm index b0117016e38b..be8bfada5d06 100644 --- a/code/controllers/subsystem/nanoui.dm +++ b/code/controllers/subsystem/nanoui.dm @@ -7,9 +7,7 @@ SUBSYSTEM_DEF(nano) var/list/currentrun = list() var/datum/nanomanager/nanomanager -/datum/controller/subsystem/nano/New() - . = ..() - +/datum/controller/subsystem/nano/PreInit() nanomanager = new() /datum/controller/subsystem/nano/stat_entry(msg) diff --git a/code/datums/diseases/advance/symptoms/weight.dm b/code/datums/diseases/advance/symptoms/weight.dm index 1e0dc978e392..f0cdf5b3e330 100644 --- a/code/datums/diseases/advance/symptoms/weight.dm +++ b/code/datums/diseases/advance/symptoms/weight.dm @@ -107,7 +107,7 @@ Bonus transmittable = -2 level = 4 -/datum/symptom/weight_loss/Activate(datum/disease/advance/A) +/datum/symptom/weight_even/Activate(datum/disease/advance/A) ..() if(prob(SYMPTOM_ACTIVATION_PROB)) var/mob/living/M = A.affected_mob diff --git a/code/datums/effects/mob_crit/crit.dm b/code/datums/effects/mob_crit/crit.dm index 1f32ada57960..40f1b252942e 100644 --- a/code/datums/effects/mob_crit/crit.dm +++ b/code/datums/effects/mob_crit/crit.dm @@ -3,7 +3,7 @@ duration = 30 flags = INF_DURATION | NO_PROCESS_ON_DEATH | DEL_ON_UNDEFIBBABLE -/datum/effects/pain/validate_atom(atom/A) +/datum/effects/crit/validate_atom(atom/A) if(isobj(A)) return FALSE . = ..() diff --git a/code/datums/emergency_calls/upp_commando.dm b/code/datums/emergency_calls/upp_commando.dm index 711d83c629bb..3e4892f35aec 100644 --- a/code/datums/emergency_calls/upp_commando.dm +++ b/code/datums/emergency_calls/upp_commando.dm @@ -54,7 +54,7 @@ /datum/emergency_call/upp_commando/low_threat name = "UPP Commandos" -/datum/emergency_call/upp_commando/create_member(datum/mind/mind, turf/override_spawn_loc) +/datum/emergency_call/upp_commando/low_threat/create_member(datum/mind/mind, turf/override_spawn_loc) var/turf/spawn_loc = override_spawn_loc ? override_spawn_loc : get_spawn_point() if(!istype(spawn_loc)) diff --git a/code/datums/entities/player.dm b/code/datums/entities/player.dm index 0cba1c1f303a..41ee35fbe179 100644 --- a/code/datums/entities/player.dm +++ b/code/datums/entities/player.dm @@ -505,6 +505,8 @@ BSQL_PROTECT_DATUM(/datum/entity/player) load_player_data_info(get_player_from_key(ckey)) /client/proc/load_player_data_info(datum/entity/player/player) + set waitfor = FALSE + if(ckey != player.ckey) error("ALARM: MISMATCH. Loaded player data for client [ckey], player data ckey is [player.ckey], id: [player.id]") player_data = player @@ -524,6 +526,23 @@ BSQL_PROTECT_DATUM(/datum/entity/player) record_login_triplet(player.ckey, address, computer_id) player_data.sync() + if(isSenator(src)) + add_verb(src, /client/proc/whitelist_panel) + if(isCouncil(src)) + add_verb(src, /client/proc/other_records) + + if(GLOB.RoleAuthority && check_whitelist_status(WHITELIST_PREDATOR)) + clan_info = GET_CLAN_PLAYER(player.id) + clan_info.sync() + + if(check_whitelist_status(WHITELIST_YAUTJA_LEADER)) + clan_info.clan_rank = GLOB.clan_ranks_ordered[CLAN_RANK_ADMIN] + clan_info.permissions |= CLAN_PERMISSION_ALL + else + clan_info.permissions &= ~CLAN_PERMISSION_ADMIN_MANAGER // Only the leader can manage the ancients + + clan_info.save() + /datum/entity/player/proc/check_ban(computer_id, address, is_telemetry) . = list() diff --git a/code/game/area/Sulaco.dm b/code/game/area/Sulaco.dm index c1fad4eb715c..54e55b8581c7 100644 --- a/code/game/area/Sulaco.dm +++ b/code/game/area/Sulaco.dm @@ -61,10 +61,7 @@ icon_state = "away1" -/area/shuttle/drop2/Enter(atom/movable/O, atom/oldloc) - if(istype(O, /obj/structure/barricade)) - return FALSE - return TRUE + /area/shuttle/drop2 //soundscape_playlist = list('sound/soundscape/drum1.ogg') @@ -74,6 +71,11 @@ ceiling = CEILING_REINFORCED_METAL base_lighting_alpha = 0 +/area/shuttle/drop2/Enter(atom/movable/O, atom/oldloc) + if(istype(O, /obj/structure/barricade)) + return FALSE + return TRUE + /area/shuttle/drop2/sulaco name = "\improper Dropship Normandy" icon_state = "shuttle" @@ -114,12 +116,6 @@ name = "\improper Normandy Landing Zone" icon_state = "away2" - -/area/shuttle/drop2/Enter(atom/movable/O, atom/oldloc) - if(istype(O, /obj/structure/barricade)) - return FALSE - return TRUE - /area/shuttle/drop3 //soundscape_playlist = list('sound/soundscape/drum1.ogg') soundscape_interval = 30 //seconds @@ -128,6 +124,11 @@ ceiling = CEILING_REINFORCED_METAL base_lighting_alpha = 0 +/area/shuttle/drop3/Enter(atom/movable/O, atom/oldloc) + if(istype(O, /obj/structure/barricade)) + return FALSE + return TRUE + /area/shuttle/drop3/sulaco name = "\improper Dropship Saipan" icon_state = "shuttle" diff --git a/code/game/gamemodes/extended/extended.dm b/code/game/gamemodes/extended/extended.dm index 80a11be44cc4..652d8af65a12 100644 --- a/code/game/gamemodes/extended/extended.dm +++ b/code/game/gamemodes/extended/extended.dm @@ -8,7 +8,7 @@ var/next_research_allocation = 0 taskbar_icon = 'icons/taskbar/gml_colonyrp.png' -/datum/game_mode/announce() +/datum/game_mode/extended/announce() to_world("The current game mode is - Extended!") /datum/game_mode/extended/get_roles_list() diff --git a/code/game/jobs/whitelist.dm b/code/game/jobs/whitelist.dm index adf3c5e7088e..d884d86329de 100644 --- a/code/game/jobs/whitelist.dm +++ b/code/game/jobs/whitelist.dm @@ -21,14 +21,6 @@ if(player.check_whitelist_status(WHITELIST_FAX_RESPONDER)) LAZYADD(., "responder") -/client/load_player_data_info(datum/entity/player/player) - . = ..() - - if(isSenator(src)) - add_verb(src, /client/proc/whitelist_panel) - if(isCouncil(src)) - add_verb(src, /client/proc/other_records) - /client var/datum/whitelist_panel/wl_panel diff --git a/code/game/machinery/OpTable.dm b/code/game/machinery/OpTable.dm index 8e84113d849f..016d7b45b5d8 100644 --- a/code/game/machinery/OpTable.dm +++ b/code/game/machinery/OpTable.dm @@ -171,10 +171,6 @@ else if(ismob(A)) ..() -/obj/structure/machinery/optable/power_change() - ..() - update_icon() - /obj/structure/machinery/optable/update_icon() if(inoperable()) icon_state = "table2-idle" diff --git a/code/game/machinery/air_alarm.dm b/code/game/machinery/air_alarm.dm index 56fd46507dcc..cd87b10d5ff7 100644 --- a/code/game/machinery/air_alarm.dm +++ b/code/game/machinery/air_alarm.dm @@ -106,11 +106,13 @@ var/apply_danger_level = 1 var/post_alert = 1 - - /obj/structure/machinery/alarm/Initialize(mapload, direction, building = 0) . = ..() + set_frequency(frequency) + if (!master_is_operating()) + elect_master() + if(building) if(loc) forceMove(loc) @@ -133,7 +135,6 @@ first_run() - /obj/structure/machinery/alarm/proc/first_run() alarm_area = get_area(src) area_uid = alarm_area.uid @@ -148,13 +149,6 @@ TLV["pressure"] = list(ONE_ATMOSPHERE*0.80,ONE_ATMOSPHERE*0.90,ONE_ATMOSPHERE*1.10,ONE_ATMOSPHERE*1.20) /* kpa */ TLV["temperature"] = list(T0C-26, T0C, T0C+40, T0C+66) // K - -/obj/structure/machinery/alarm/Initialize() - . = ..() - set_frequency(frequency) - if (!master_is_operating()) - elect_master() - /obj/structure/machinery/alarm/Destroy() if(alarm_area.master_air_alarm == src) alarm_area.master_air_alarm = null @@ -1017,10 +1011,6 @@ table tr:first-child th:first-child { border: none;} return ..() -/obj/structure/machinery/alarm/power_change() - ..() - update_icon() - /obj/structure/machinery/alarm/get_examine_text(mob/user) . = ..() if (buildstage < 2) diff --git a/code/game/machinery/computer/computer.dm b/code/game/machinery/computer/computer.dm index fc66a3143207..7bdaeb8692b0 100644 --- a/code/game/machinery/computer/computer.dm +++ b/code/game/machinery/computer/computer.dm @@ -76,13 +76,6 @@ icon_state = initial(icon_state) icon_state += "0" - - -/obj/structure/machinery/computer/power_change() - ..() - update_icon() - - /obj/structure/machinery/computer/proc/set_broken() stat |= BROKEN update_icon() diff --git a/code/game/machinery/computer/dropship_weapons.dm b/code/game/machinery/computer/dropship_weapons.dm index 9cb76e667c67..e2c3b58cf2fb 100644 --- a/code/game/machinery/computer/dropship_weapons.dm +++ b/code/game/machinery/computer/dropship_weapons.dm @@ -38,6 +38,11 @@ var/registered = FALSE +/obj/structure/machinery/computer/dropship_weapons/New() + ..() + if(firemission_envelope) + firemission_envelope.linked_console = src + /obj/structure/machinery/computer/dropship_weapons/Initialize() . = ..() simulation = new() @@ -49,18 +54,15 @@ AddComponent(/datum/component/camera_manager) SEND_SIGNAL(src, COMSIG_CAMERA_CLEAR) -/obj/structure/machinery/computer/dropship_weapons/New() - ..() - if(firemission_envelope) - firemission_envelope.linked_console = src - -/obj/structure/machinery/computer/dropship_weapons/proc/camera_mapname_update(source, value) - camera_map_name = value - /obj/structure/machinery/computer/dropship_weapons/Destroy() . = ..() + QDEL_NULL(firemission_envelope) + QDEL_NULL(tacmap) UnregisterSignal(src, COMSIG_CAMERA_MAPNAME_ASSIGNED) +/obj/structure/machinery/computer/dropship_weapons/proc/camera_mapname_update(source, value) + camera_map_name = value + /obj/structure/machinery/computer/dropship_weapons/attack_hand(mob/user) if(..()) return @@ -913,13 +915,7 @@ firemission_envelope = new /datum/cas_fire_envelope/uscm_dropship() shuttle_tag = DROPSHIP_SAIPAN -/obj/structure/machinery/computer/dropship_weapons/Destroy() - . = ..() - QDEL_NULL(firemission_envelope) - QDEL_NULL(tacmap) - /obj/structure/machinery/computer/dropship_weapons/proc/simulate_firemission(mob/living/user) - if(!configuration) to_chat(user, SPAN_WARNING("Configure a firemission before attempting to run the simulation")) return diff --git a/code/game/machinery/cryo.dm b/code/game/machinery/cryo.dm index 70c4a175489c..e3c0c39bb45b 100644 --- a/code/game/machinery/cryo.dm +++ b/code/game/machinery/cryo.dm @@ -30,6 +30,8 @@ start_processing() /obj/structure/machinery/cryo_cell/Destroy() + if(occupant) + go_out() QDEL_NULL(beaker) . = ..() @@ -186,18 +188,12 @@ . = ..() if((occupant || on) && operable()) update_use_power(USE_POWER_ACTIVE) - update_icon() /obj/structure/machinery/cryo_cell/update_icon() icon_state = initial(icon_state) var/is_on = on && operable() icon_state = "[icon_state]-[is_on ? "on" : "off"]-[occupant ? "occupied" : "empty"]" -/obj/structure/machinery/cryo_cell/Destroy() - if(occupant) - go_out() - . = ..() - /obj/structure/machinery/cryo_cell/proc/process_occupant() if(!occupant) return diff --git a/code/game/machinery/door_display/door_display.dm b/code/game/machinery/door_display/door_display.dm index b26c4b82fdf9..ca5dd58c0c88 100644 --- a/code/game/machinery/door_display/door_display.dm +++ b/code/game/machinery/door_display/door_display.dm @@ -39,14 +39,6 @@ stat |= BROKEN update_icon() - -// has the door power situation changed, if so update icon. -/obj/structure/machinery/door_display/power_change() - ..() - update_icon() - return - - // open/closedoor checks if door_display has power, if so it checks if the // linked door is open/closed (by density) then opens it/closes it. @@ -218,9 +210,6 @@ open_shutter(TRUE) open_door(TRUE) -/obj/structure/machinery/door_display/update_icon() - return - // TGUI \\ /obj/structure/machinery/door_display/research_cell/tgui_interact(mob/user, datum/tgui/ui) diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index 4c111bf4bef3..5da5e356bf2a 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -102,9 +102,6 @@ GLOBAL_LIST_INIT(airlock_wire_descriptions, list( return ..(user) -/obj/structure/machinery/door/airlock/bumpopen(mob/living/simple_animal/user as mob) - ..(user) - /// DAMAGE CODE /obj/structure/machinery/door/airlock/get_examine_text(mob/user) @@ -850,6 +847,12 @@ GLOBAL_LIST_INIT(airlock_wire_descriptions, list( var/area/A = get_area(loc) name = A.name + if(frequency) + set_frequency(frequency) + + update_icon() + start_processing() + return INITIALIZE_HINT_LATELOAD /obj/structure/machinery/door/airlock/LateInitialize() diff --git a/code/game/machinery/doors/airlock_control.dm b/code/game/machinery/doors/airlock_control.dm index 4d1c989a42aa..40a09476c385 100644 --- a/code/game/machinery/doors/airlock_control.dm +++ b/code/game/machinery/doors/airlock_control.dm @@ -128,15 +128,6 @@ frequency = new_frequency radio_connection = SSradio.add_object(src, frequency, RADIO_AIRLOCK) - -/obj/structure/machinery/door/airlock/Initialize() - . = ..() - if(frequency) - set_frequency(frequency) - - update_icon() - start_processing() - /obj/structure/machinery/airlock_sensor icon = 'icons/obj/structures/machinery/airlock_machines.dmi' icon_state = "airlock_sensor_off" diff --git a/code/game/machinery/doors/brig_system.dm b/code/game/machinery/doors/brig_system.dm index 045f86118c56..ca50e44bfca1 100644 --- a/code/game/machinery/doors/brig_system.dm +++ b/code/game/machinery/doors/brig_system.dm @@ -334,11 +334,6 @@ if (maptext) maptext = "" -/obj/structure/machinery/brig_cell/power_change() - ..() - - update_icon() - /obj/structure/machinery/brig_cell/attackby(obj/item/W, mob/living/user) if(!istype(W, /obj/item/paper/incident)) return diff --git a/code/game/machinery/doors/poddoor/shutters/shutters.dm b/code/game/machinery/doors/poddoor/shutters/shutters.dm index 1d3469fc57e8..4a927f99929a 100644 --- a/code/game/machinery/doors/poddoor/shutters/shutters.dm +++ b/code/game/machinery/doors/poddoor/shutters/shutters.dm @@ -115,9 +115,6 @@ /obj/structure/machinery/door/poddoor/shutters/almayer/yautja/hunting_grounds/Initialize() . = ..() RegisterSignal(SSdcs, COMSIG_GLOB_YAUTJA_PRESERVE_OPENED, PROC_REF(open)) - -/obj/structure/machinery/door/poddoor/shutters/almayer/yautja/hunting_grounds/Initialize() - . = ..() RegisterSignal(SSdcs, COMSIG_GLOB_YAUTJA_PRESERVE_CLOSED, PROC_REF(close)) /obj/structure/machinery/door/poddoor/shutters/almayer/containment diff --git a/code/game/machinery/doors/railing.dm b/code/game/machinery/doors/railing.dm index afe3946a837f..899d7e0646c5 100644 --- a/code/game/machinery/doors/railing.dm +++ b/code/game/machinery/doors/railing.dm @@ -69,7 +69,7 @@ addtimer(CALLBACK(src, PROC_REF(finish_close)), 1.2 SECONDS, TIMER_UNIQUE|TIMER_OVERRIDE|TIMER_NO_HASH_WAIT) return TRUE -/obj/structure/machinery/door/poddoor/finish_close() +/obj/structure/machinery/door/poddoor/railing/finish_close() if(operating != DOOR_OPERATING_CLOSING) return diff --git a/code/game/machinery/fax_machine.dm b/code/game/machinery/fax_machine.dm index 301219a2359b..411e85cd16f9 100644 --- a/code/game/machinery/fax_machine.dm +++ b/code/game/machinery/fax_machine.dm @@ -75,6 +75,17 @@ GLOBAL_LIST_EMPTY(all_faxcodes) update_departments() generate_id_tag() + if(mapload && (department in HIGHCOM_DEPARTMENTS)) + for(var/datum/fax/fax as anything in GLOB.fax_contents) + if(fax.department != department) + continue + + var/obj/item/paper/paper = new(get_turf(src)) + paper.info = fax.data + paper.update_icon() + + paper.stamps += "
This paper has been sent by [fax.fax_id_tag]." + /obj/structure/machinery/faxmachine/proc/generate_id_tag(force = FALSE) if(fixed_id_tag && !force) return FALSE @@ -653,20 +664,6 @@ GLOBAL_LIST_EMPTY(all_faxcodes) network = FAX_NET_PRESS_HC target_department = "General Public" -/obj/structure/machinery/faxmachine/Initialize(mapload, ...) - . = ..() - - if(mapload && (department in HIGHCOM_DEPARTMENTS)) - for(var/datum/fax/fax as anything in GLOB.fax_contents) - if(fax.department != department) - continue - - var/obj/item/paper/paper = new(get_turf(src)) - paper.info = fax.data - paper.update_icon() - - paper.stamps += "
This paper has been sent by [fax.fax_id_tag]." - ///The deployed fax machine backpack /obj/structure/machinery/faxmachine/backpack name = "\improper Portable Press Fax Machine" diff --git a/code/game/machinery/fire_alarm.dm b/code/game/machinery/fire_alarm.dm index 58982a69fe93..e1db455e08de 100644 --- a/code/game/machinery/fire_alarm.dm +++ b/code/game/machinery/fire_alarm.dm @@ -21,6 +21,23 @@ FIRE ALARM if(is_mainship_level(z)) RegisterSignal(SSdcs, COMSIG_GLOB_SECURITY_LEVEL_CHANGED, PROC_REF(sec_changed)) + if(dir) + setDir(dir) + + if(building) + buildstage = 0 + wiresexposed = 1 + pixel_x = (dir & 3)? 0 : (dir == 4 ? -24 : 24) + pixel_y = (dir & 3)? (dir ==1 ? -24 : 24) : 0 + + if(!is_mainship_level(z)) + if(GLOB.security_level) + overlays += image('icons/obj/structures/machinery/monitors.dmi', "overlay_[get_security_level()]") + else + overlays += image('icons/obj/structures/machinery/monitors.dmi', "overlay_green") + + update_icon() + /obj/structure/machinery/firealarm/proc/sec_changed(datum/source, new_sec) SIGNAL_HANDLER switch(new_sec) @@ -126,10 +143,6 @@ FIRE ALARM . = ..() return -/obj/structure/machinery/firealarm/power_change() - ..() - addtimer(CALLBACK(src, PROC_REF(update_icon)), rand(0,15)) - /obj/structure/machinery/firealarm/attack_hand(mob/user as mob) if(user.stat || inoperable()) return @@ -169,23 +182,3 @@ FIRE ALARM area.firealert() update_icon() return - -/obj/structure/machinery/firealarm/Initialize(mapload, dir, building) - . = ..() - - if(dir) - src.setDir(dir) - - if(building) - buildstage = 0 - wiresexposed = 1 - pixel_x = (dir & 3)? 0 : (dir == 4 ? -24 : 24) - pixel_y = (dir & 3)? (dir ==1 ? -24 : 24) : 0 - - if(!is_mainship_level(z)) - if(GLOB.security_level) - src.overlays += image('icons/obj/structures/machinery/monitors.dmi', "overlay_[get_security_level()]") - else - src.overlays += image('icons/obj/structures/machinery/monitors.dmi', "overlay_green") - - update_icon() diff --git a/code/game/machinery/fuelcell_recycler.dm b/code/game/machinery/fuelcell_recycler.dm index 9e0881784288..2d5ce6ceef97 100644 --- a/code/game/machinery/fuelcell_recycler.dm +++ b/code/game/machinery/fuelcell_recycler.dm @@ -122,10 +122,6 @@ update_icon() -/obj/structure/machinery/fuelcell_recycler/power_change() - ..() - update_icon() - /obj/structure/machinery/fuelcell_recycler/update_icon() overlays.Cut() diff --git a/code/game/machinery/holosign.dm b/code/game/machinery/holosign.dm index 41c63d465918..c7641b30f5ce 100644 --- a/code/game/machinery/holosign.dm +++ b/code/game/machinery/holosign.dm @@ -22,9 +22,11 @@ icon_state = on_icon /obj/structure/machinery/holosign/power_change() + . = ..() if(stat & NOPOWER) - lit = 0 - update_icon() + if(lit) + lit = FALSE + update_icon() /obj/structure/machinery/holosign/surgery name = "surgery holosign" diff --git a/code/game/machinery/igniter.dm b/code/game/machinery/igniter.dm index 6109833004d6..b52f999918e1 100644 --- a/code/game/machinery/igniter.dm +++ b/code/game/machinery/igniter.dm @@ -58,7 +58,6 @@ /obj/structure/machinery/sparker/power_change() ..() if ( !(stat & NOPOWER) && disable == 0 ) - icon_state = "[base_state]" // src.sd_set_light(2) else diff --git a/code/game/machinery/kitchen/microwave.dm b/code/game/machinery/kitchen/microwave.dm index 88d8d77e8544..21f1665818b8 100644 --- a/code/game/machinery/kitchen/microwave.dm +++ b/code/game/machinery/kitchen/microwave.dm @@ -49,11 +49,6 @@ // impure carbon. ~Z acceptable_items |= /obj/item/holder -/obj/structure/machinery/initialize_pass_flags(datum/pass_flags_container/PF) - ..() - if (PF) - PF.flags_can_pass_all = PASS_HIGH_OVER_ONLY|PASS_AROUND|PASS_OVER_THROW_ITEM - //******************* //* Item Adding //********************/ diff --git a/code/game/machinery/kitchen/smartfridge.dm b/code/game/machinery/kitchen/smartfridge.dm index e28372367ff2..f047a4aa5f8b 100644 --- a/code/game/machinery/kitchen/smartfridge.dm +++ b/code/game/machinery/kitchen/smartfridge.dm @@ -72,11 +72,11 @@ /obj/structure/machinery/smartfridge/power_change() ..() if( !(stat & NOPOWER) ) - src.ispowered = TRUE + ispowered = TRUE icon_state = icon_on else spawn(rand(0, 15)) - src.ispowered = FALSE + ispowered = FALSE icon_state = icon_off //******************* diff --git a/code/game/machinery/lightswitch.dm b/code/game/machinery/lightswitch.dm index de61830c2501..60c920ec7b3d 100644 --- a/code/game/machinery/lightswitch.dm +++ b/code/game/machinery/lightswitch.dm @@ -52,15 +52,12 @@ area.power_change() /obj/structure/machinery/light_switch/power_change() - if(!otherarea) - if(powered(POWER_CHANNEL_LIGHT) || !src.needs_power) + if(powered(POWER_CHANNEL_LIGHT) || !needs_power) stat &= ~NOPOWER else stat |= NOPOWER - updateicon() - /obj/structure/machinery/light_switch/emp_act(severity) . = ..() if(inoperable()) diff --git a/code/game/machinery/machinery.dm b/code/game/machinery/machinery.dm index eb37421e5b95..ae15001af4ee 100644 --- a/code/game/machinery/machinery.dm +++ b/code/game/machinery/machinery.dm @@ -149,9 +149,8 @@ Class Procs: . = ..() /obj/structure/machinery/initialize_pass_flags(datum/pass_flags_container/PF) - ..() - if (PF) - PF.flags_can_pass_all = PASS_HIGH_OVER_ONLY|PASS_AROUND + if(PF) + PF.flags_can_pass_all = PASS_HIGH_OVER_ONLY|PASS_AROUND|PASS_OVER_THROW_ITEM // Previously microwave.dm mistakenly gave everything PASS_OVER_THROW_ITEM /obj/structure/machinery/proc/start_processing() if(!machine_processing) diff --git a/code/game/machinery/medical_pod/bodyscanner.dm b/code/game/machinery/medical_pod/bodyscanner.dm index 702afe7049bf..cede827c9dfa 100644 --- a/code/game/machinery/medical_pod/bodyscanner.dm +++ b/code/game/machinery/medical_pod/bodyscanner.dm @@ -127,12 +127,12 @@ ..() if(stat & BROKEN) icon_state = "body_scannerconsole-p" + return + if(stat & NOPOWER) + spawn(rand(0, 15)) + icon_state = "body_scannerconsole-p" else - if (stat & NOPOWER) - spawn(rand(0, 15)) - src.icon_state = "body_scannerconsole-p" - else - icon_state = initial(icon_state) + icon_state = initial(icon_state) diff --git a/code/game/machinery/recharger.dm b/code/game/machinery/recharger.dm index bb72d3d759f6..f344abda89c6 100644 --- a/code/game/machinery/recharger.dm +++ b/code/game/machinery/recharger.dm @@ -213,10 +213,6 @@ return */ -/obj/structure/machinery/recharger/power_change() - ..() - update_icon() - /obj/structure/machinery/recharger/emp_act(severity) . = ..() if(inoperable() || !anchored) diff --git a/code/game/machinery/sentry_holder.dm b/code/game/machinery/sentry_holder.dm index e9904b8f61d5..7dfb71acc717 100644 --- a/code/game/machinery/sentry_holder.dm +++ b/code/game/machinery/sentry_holder.dm @@ -107,11 +107,6 @@ pixel_y = oy icon_state = "[base_icon_state]_installed" -/obj/structure/machinery/sentry_holder/Destroy() - QDEL_NULL(deployed_turret) - - . = ..() - /obj/structure/machinery/sentry_holder/colony desc = "A box that deploys a sentry turret for protection of the residents in the area." turret_path = /obj/structure/machinery/defenses/sentry/premade/deployable/colony diff --git a/code/game/machinery/suit_storage_unit.dm b/code/game/machinery/suit_storage_unit.dm index 200e5d185ec3..10440271ac3f 100644 --- a/code/game/machinery/suit_storage_unit.dm +++ b/code/game/machinery/suit_storage_unit.dm @@ -71,9 +71,9 @@ ..() if(stat & NOPOWER) dump_everything() - isUV = 0 - update_icon() - + if(isUV) + isUV = FALSE + update_icon() /obj/structure/machinery/suit_storage_unit/ex_act(severity) switch(severity) diff --git a/code/game/machinery/telecomms/presets.dm b/code/game/machinery/telecomms/presets.dm index 32b9ec94a46e..5416d8d610dc 100644 --- a/code/game/machinery/telecomms/presets.dm +++ b/code/game/machinery/telecomms/presets.dm @@ -26,6 +26,8 @@ /obj/structure/machinery/telecomms/relay/preset/ice_colony/attackby() return +GLOBAL_LIST_EMPTY(all_static_telecomms_towers) + /obj/structure/machinery/telecomms/relay/preset/tower name = "TC-4T telecommunications tower" icon = 'icons/obj/structures/machinery/comm_tower2.dmi' @@ -44,11 +46,15 @@ freq_listening = DEPT_FREQS /obj/structure/machinery/telecomms/relay/preset/tower/Initialize() + GLOB.all_static_telecomms_towers += src . = ..() - if(z) SSminimaps.add_marker(src, z, MINIMAP_FLAG_ALL, "supply") +/obj/structure/machinery/telecomms/relay/preset/tower/Destroy() + GLOB.all_static_telecomms_towers -= src + . = ..() + // doesn't need power, instead uses health /obj/structure/machinery/telecomms/relay/preset/tower/inoperable(additional_flags) if(stat & (additional_flags|BROKEN)) @@ -186,16 +192,6 @@ freq_listening = list(COLONY_FREQ) faction_shorthand = "colony" -GLOBAL_LIST_EMPTY(all_static_telecomms_towers) - -/obj/structure/machinery/telecomms/relay/preset/tower/Initialize() - GLOB.all_static_telecomms_towers += src - . = ..() - -/obj/structure/machinery/telecomms/relay/preset/tower/Destroy() - GLOB.all_static_telecomms_towers -= src - . = ..() - /obj/structure/machinery/telecomms/relay/preset/tower/mapcomms name = "TC-3T static telecommunications tower" desc = "A static heavy-duty TC-3T telecommunications tower. Used to set up subspace communications lines between planetary and extra-planetary locations. Will need to have extra communication frequencies programmed into it by multitool." @@ -301,10 +297,8 @@ GLOBAL_LIST_EMPTY(all_static_telecomms_towers) if((stat & NOPOWER)) if(on) toggle_state() - on = 0 - update_icon() - else - update_icon() + on = FALSE + update_icon() /obj/structure/machinery/telecomms/relay/preset/tower/mapcomms/update_state() ..() diff --git a/code/game/machinery/teleporter.dm b/code/game/machinery/teleporter.dm index 1e82644a9587..548a607e2e9c 100644 --- a/code/game/machinery/teleporter.dm +++ b/code/game/machinery/teleporter.dm @@ -11,13 +11,11 @@ /obj/structure/machinery/computer/teleporter/Initialize() . = ..() + src.id = "[rand(1000, 9999)]" underlays.Cut() underlays += image('icons/obj/structures/props/stationobjs.dmi', icon_state = "telecomp-wires") - return -/obj/structure/machinery/computer/teleporter/Initialize() - . = ..() var/obj/structure/machinery/teleport/station/station = locate(/obj/structure/machinery/teleport/station, get_step(src, dir)) var/obj/structure/machinery/teleport/hub/hub if(station) @@ -35,7 +33,6 @@ QDEL_NULL(locked) . = ..() - /obj/structure/machinery/computer/teleporter/attackby(I as obj, mob/living/user as mob) if(istype(I, /obj/item/card/data/)) var/obj/item/card/data/C = I @@ -83,8 +80,8 @@ return -/obj/structure/machinery/teleport/station/attack_remote() - src.attack_hand() +/obj/structure/machinery/computer/teleport/station/attack_remote() + attack_hand() /obj/structure/machinery/computer/teleporter/attack_hand() if(inoperable()) diff --git a/code/game/machinery/vending/cm_vending.dm b/code/game/machinery/vending/cm_vending.dm index d61ef3e93261..ea31149c72ad 100644 --- a/code/game/machinery/vending/cm_vending.dm +++ b/code/game/machinery/vending/cm_vending.dm @@ -73,12 +73,7 @@ IN_USE used for vending/denying . = ..() cm_build_inventory(get_listed_products(), 1, 3) -/obj/structure/machinery/cm_vending/power_change(area/master_area = null) - ..() - update_icon() - /obj/structure/machinery/cm_vending/update_icon() - //restoring sprite to initial overlays.Cut() //icon_state = initial(icon_state) //shouldn't be needed but just in case diff --git a/code/game/machinery/vending/vending.dm b/code/game/machinery/vending/vending.dm index e987ca39bcea..47cb0fbdddea 100644 --- a/code/game/machinery/vending/vending.dm +++ b/code/game/machinery/vending/vending.dm @@ -919,13 +919,6 @@ GLOBAL_LIST_EMPTY_TYPED(total_vending_machines, /obj/structure/machinery/vending mob.show_message("[src] beeps, \"[message]\"", SHOW_MESSAGE_AUDIBLE) return -/obj/structure/machinery/vending/power_change() - ..() - if(stat & NOPOWER) - addtimer(CALLBACK(src, PROC_REF(update_icon)), rand(1, 15)) - return - update_icon() - //Oh no we're malfunctioning! Dump out some product and break. /obj/structure/machinery/vending/proc/malfunction() if(stat & BROKEN) diff --git a/code/game/machinery/vending/vendor_types/crew/vehicle_crew.dm b/code/game/machinery/vending/vendor_types/crew/vehicle_crew.dm index 30543618df0c..26dfca77e624 100644 --- a/code/game/machinery/vending/vendor_types/crew/vehicle_crew.dm +++ b/code/game/machinery/vending/vendor_types/crew/vehicle_crew.dm @@ -35,9 +35,9 @@ return ..() /obj/structure/machinery/cm_vending/gear/vehicle_crew/get_appropriate_vend_turf(mob/living/carbon/human/H) - var/turf/T = loc - T = get_step(T, SOUTH) - return T + var/turf/target = get_turf(src) + target = get_step(target, SOUTH) + return target /obj/structure/machinery/cm_vending/gear/vehicle_crew/tip_over() //we don't do this here return @@ -45,7 +45,7 @@ /obj/structure/machinery/cm_vending/gear/vehicle_crew/flip_back() return -/obj/structure/machinery/cm_vending/ex_act(severity) +/obj/structure/machinery/cm_vending/gear/vehicle_crew/ex_act(severity) if(severity > EXPLOSION_THRESHOLD_LOW) if(prob(25)) malfunction() @@ -120,11 +120,6 @@ return FALSE budget_points -= L[2] -/obj/structure/machinery/cm_vending/gear/vehicle_crew/get_appropriate_vend_turf(mob/living/carbon/human/H) - var/turf/T = get_turf(src) - T = get_step(T, SOUTH) - return T - GLOBAL_LIST_INIT(cm_vending_vehicle_crew_tank, list( list("STARTING KIT SELECTION:", 0, null, null, null), diff --git a/code/game/objects/items/backpack_sprayers.dm b/code/game/objects/items/backpack_sprayers.dm index 4dd13924a3f6..84ff3f87ee98 100644 --- a/code/game/objects/items/backpack_sprayers.dm +++ b/code/game/objects/items/backpack_sprayers.dm @@ -81,8 +81,8 @@ /obj/item/reagent_container/glass/watertank/attackby(obj/item/W, mob/user, params) if(W == noz) remove_noz() - else - . = ..() + return TRUE + return ..() /obj/item/reagent_container/glass/watertank/verb/toggle_mister_verb() set name = "Toggle Mister" @@ -108,13 +108,6 @@ usr.put_in_l_hand(src) add_fingerprint(usr) -/obj/item/reagent_container/glass/watertank/attackby(obj/item/W, mob/user, params) - if(W == noz) - remove_noz() - return 1 - else - return ..() - /obj/item/reagent_container/glass/watertank/dropped(mob/user) ..() remove_noz() diff --git a/code/game/objects/items/cprbot_item.dm b/code/game/objects/items/cprbot_item.dm index 279c1a930a3b..5c170c08336e 100644 --- a/code/game/objects/items/cprbot_item.dm +++ b/code/game/objects/items/cprbot_item.dm @@ -42,35 +42,6 @@ icon_state = "cprbot_broken" w_class = SIZE_MEDIUM -/obj/item/cprbot_broken/attackby(obj/item/attacked_by, mob/living/user) - if(iswelder(attacked_by)) - if(!HAS_TRAIT(attacked_by, TRAIT_TOOL_BLOWTORCH)) - to_chat(user, SPAN_WARNING("You need a stronger blowtorch!")) - return - - var/obj/item/tool/weldingtool/welder_tool = attacked_by - if(!welder_tool.isOn()) - to_chat(user, SPAN_WARNING("The [welder_tool] needs to be on!")) - return - - if(!welder_tool.remove_fuel(5, user)) // Ensure the welder has enough fuel to operate - to_chat(user, SPAN_NOTICE("You need more welding fuel to complete this task.")) - return - - playsound(src, 'sound/items/Welder.ogg', 25, 1) - - if(!do_after(user, 10 * user.get_skill_duration_multiplier(SKILL_CONSTRUCTION), INTERRUPT_ALL | BEHAVIOR_IMMOBILE, BUSY_ICON_BUILD)) - return - - var/obj/item/cprbot_item/new_cprbot_item = new /obj/item/cprbot_item(loc) - - if(user) - if(!user.put_in_active_hand(new_cprbot_item)) - if(!user.put_in_inactive_hand(new_cprbot_item)) - new_cprbot_item.forceMove(loc) - else - new_cprbot_item.forceMove(loc) - /obj/item/cprbot_broken/attackby(obj/item/attacked_by, mob/living/user) if(iswelder(attacked_by)) if(!HAS_TRAIT(attacked_by, TRAIT_TOOL_BLOWTORCH)) diff --git a/code/game/objects/items/devices/motion_detector.dm b/code/game/objects/items/devices/motion_detector.dm index 8447afba1249..7a1947753ddb 100644 --- a/code/game/objects/items/devices/motion_detector.dm +++ b/code/game/objects/items/devices/motion_detector.dm @@ -56,8 +56,13 @@ update_icon() /obj/item/device/motiondetector/Destroy() - . = ..() + STOP_PROCESSING(SSobj, src) + for(var/to_delete in blip_pool) + qdel(blip_pool[to_delete]) + blip_pool.Remove(to_delete) + blip_pool = null range_bounds = null + return ..() /obj/item/device/motiondetector/update_icon() //clear overlays @@ -152,14 +157,6 @@ playsound(loc, 'sound/items/detector_turn_off.ogg', 30, FALSE, 5, 2) STOP_PROCESSING(SSobj, src) -/obj/item/device/motiondetector/Destroy() - STOP_PROCESSING(SSobj, src) - for(var/to_delete in blip_pool) - qdel(blip_pool[to_delete]) - blip_pool.Remove(to_delete) - blip_pool = null - return ..() - /obj/item/device/motiondetector/process() if(isturf(loc)) toggle_active(null, TRUE) diff --git a/code/game/objects/items/implants/implant.dm b/code/game/objects/items/implants/implant.dm index 6584186f576a..2c644b2744ce 100644 --- a/code/game/objects/items/implants/implant.dm +++ b/code/game/objects/items/implants/implant.dm @@ -267,6 +267,7 @@ Implant Specifics:
"} /obj/item/implant/chem/Initialize() . = ..() GLOB.chem_implant_list += src + create_reagents(50) /obj/item/implant/chem/Destroy() GLOB.chem_implant_list -= src @@ -326,10 +327,6 @@ the implant may become unstable and either pre-maturely inject the subject or si spawn(20) malfunction-- -/obj/item/implant/chem/Initialize() - . = ..() - create_reagents(50) - /obj/item/implant/loyalty name = "loyalty implant" desc = "Makes you loyal or such." diff --git a/code/game/objects/items/implants/implanter.dm b/code/game/objects/items/implants/implanter.dm index 8bcde9a4b91d..6a46673b7ddb 100644 --- a/code/game/objects/items/implants/implanter.dm +++ b/code/game/objects/items/implants/implanter.dm @@ -13,15 +13,10 @@ var/obj/item/implant/imp = null /obj/item/implanter/proc/update() - - -/obj/item/implanter/update() - if (src.imp) - src.icon_state = "implanter_alt1" + if(imp) + icon_state = "implanter_alt1" else - src.icon_state = "implanter_alt0" - return - + icon_state = "implanter_alt0" /obj/item/implanter/attack(mob/M as mob, mob/user as mob) if (!istype(M, /mob/living/carbon/human)) diff --git a/code/game/objects/items/reagent_containers/food/condiment.dm b/code/game/objects/items/reagent_containers/food/condiment.dm index 8d4d900da531..13385203bf9f 100644 --- a/code/game/objects/items/reagent_containers/food/condiment.dm +++ b/code/game/objects/items/reagent_containers/food/condiment.dm @@ -14,9 +14,6 @@ center_of_mass = "x=16;y=6" volume = 50 -/obj/item/reagent_container/food/condiment/attackby(obj/item/W, mob/user) - return - /obj/item/reagent_container/food/condiment/attack(mob/M, mob/user) if(!reagents?.total_volume) to_chat(user, SPAN_DANGER("The [src.name] is empty!")) @@ -52,7 +49,7 @@ playsound(M.loc,'sound/items/drink.ogg', 15, 1) return TRUE -/obj/item/reagent_container/food/condiment/attackby(obj/item/I as obj, mob/user as mob) +/obj/item/reagent_container/food/condiment/attackby(obj/item/W, mob/living/user, list/mods) return /obj/item/reagent_container/food/condiment/afterattack(obj/target, mob/user , flag) diff --git a/code/game/objects/items/reagent_containers/food/snacks.dm b/code/game/objects/items/reagent_containers/food/snacks.dm index 98280d5b0178..377134373b3d 100644 --- a/code/game/objects/items/reagent_containers/food/snacks.dm +++ b/code/game/objects/items/reagent_containers/food/snacks.dm @@ -519,21 +519,6 @@ visible_message(SPAN_WARNING("[name] has been squashed."),SPAN_WARNING("You hear a smack.")) qdel(src) -/obj/item/reagent_container/food/snacks/egg/attackby(obj/item/W as obj, mob/user as mob) - if(istype( W, /obj/item/toy/crayon )) - var/obj/item/toy/crayon/C = W - var/clr = C.colorName - - if(!(clr in list("blue","green","mime","orange","purple","rainbow","red","yellow"))) - to_chat(usr, SPAN_NOTICE(" The egg refuses to take on this color!")) - return - - to_chat(usr, SPAN_NOTICE(" You color \the [src] [clr]")) - icon_state = "egg-[clr]" - egg_color = clr - else - ..() - /obj/item/reagent_container/food/snacks/egg/blue icon_state = "egg-blue" egg_color = "blue" @@ -3112,12 +3097,28 @@ qdel(src) // Egg + flour = dough -/obj/item/reagent_container/food/snacks/egg/attackby(obj/item/W as obj, mob/user as mob) - if(istype(W,/obj/item/reagent_container/food/snacks/flour)) +/obj/item/reagent_container/food/snacks/egg/attackby(obj/item/W, mob/living/user, list/mods) + if(istype(W, /obj/item/reagent_container/food/snacks/flour)) new /obj/item/reagent_container/food/snacks/dough(get_turf(src)) to_chat(user, "You make some dough.") qdel(W) qdel(src) + return TRUE + + if(istype(W, /obj/item/toy/crayon)) + var/obj/item/toy/crayon/C = W + var/clr = C.colorName + + if(!(clr in list("blue","green","mime","orange","purple","rainbow","red","yellow"))) + to_chat(usr, SPAN_NOTICE("The egg refuses to take on this color!")) + return + + to_chat(usr, SPAN_NOTICE("You color [src] [clr]")) + icon_state = "egg-[clr]" + egg_color = clr + return TRUE + + return ..() /obj/item/reagent_container/food/snacks/dough name = "dough" @@ -3285,8 +3286,19 @@ new /obj/item/reagent_container/food/snacks/rawsticks(get_turf(src)) to_chat(user, "You cut the potato.") qdel(src) - else - ..() + return TRUE + + if(istype(W, /obj/item/stack/cable_coil)) + var/obj/item/stack/cable_coil/C = W + if(C.use(5)) + to_chat(user, SPAN_NOTICE("You add some cable to the potato and slide it inside the battery encasing.")) + var/obj/item/cell/potato/pocell = new /obj/item/cell/potato(user.loc) + pocell.maxcharge = src.potency * 10 + pocell.charge = pocell.maxcharge + qdel(src) + return TRUE + + return ..() /obj/item/reagent_container/food/snacks/rawsticks name = "raw potato sticks" diff --git a/code/game/objects/items/reagent_containers/food/snacks/grown.dm b/code/game/objects/items/reagent_containers/food/snacks/grown.dm index d27c86017ecc..c8e206b3b752 100644 --- a/code/game/objects/items/reagent_containers/food/snacks/grown.dm +++ b/code/game/objects/items/reagent_containers/food/snacks/grown.dm @@ -91,18 +91,6 @@ filling_color = "#E6E8DA" plantname = "potato" -/obj/item/reagent_container/food/snacks/grown/potato/attackby(obj/item/W as obj, mob/user as mob) - ..() - if(istype(W, /obj/item/stack/cable_coil)) - var/obj/item/stack/cable_coil/C = W - if(C.use(5)) - to_chat(user, SPAN_NOTICE("You add some cable to the potato and slide it inside the battery encasing.")) - var/obj/item/cell/potato/pocell = new /obj/item/cell/potato(user.loc) - pocell.maxcharge = src.potency * 10 - pocell.charge = pocell.maxcharge - qdel(src) - return - /obj/item/reagent_container/food/snacks/grown/grapes name = "bunch of grapes" desc = "Nutritious!" diff --git a/code/game/objects/items/storage/boxes.dm b/code/game/objects/items/storage/boxes.dm index 73e0c7b54b08..df084463e569 100644 --- a/code/game/objects/items/storage/boxes.dm +++ b/code/game/objects/items/storage/boxes.dm @@ -436,7 +436,7 @@ desc = "A small box full of zip cuffs." w_class = SIZE_MEDIUM -/obj/item/storage/box/zipcuffs/fill_preset_inventory() +/obj/item/storage/box/zipcuffs/small/fill_preset_inventory() new /obj/item/restraint/handcuffs/zip(src) new /obj/item/restraint/handcuffs/zip(src) new /obj/item/restraint/handcuffs/zip(src) diff --git a/code/game/objects/items/tools/kitchen_tools.dm b/code/game/objects/items/tools/kitchen_tools.dm index e6f9e102a40e..ddd0a0c2c210 100644 --- a/code/game/objects/items/tools/kitchen_tools.dm +++ b/code/game/objects/items/tools/kitchen_tools.dm @@ -129,7 +129,7 @@ force = 10 throwforce = 10 -/obj/item/tool/kitchen/utensil/knife/attack(target as mob, mob/living/user as mob) +/obj/item/tool/kitchen/utensil/pknife/attack(target as mob, mob/living/user as mob) . = ..() if(.) playsound(loc, 'sound/weapons/bladeslice.ogg', 25, 1, 5) diff --git a/code/game/objects/items/weapons/weapon.dm b/code/game/objects/items/weapons/weapon.dm index a955657189c3..738caeb6123f 100644 --- a/code/game/objects/items/weapons/weapon.dm +++ b/code/game/objects/items/weapons/weapon.dm @@ -4,7 +4,7 @@ hitsound = "swing_hit" flags_atom = FPRINT|QUICK_DRAWABLE -/obj/item/get_examine_text(mob/user) +/obj/item/weapon/get_examine_text(mob/user) . = ..() var/strong_text = "a weak" if(force >= MELEE_FORCE_TIER_1) diff --git a/code/game/objects/objs.dm b/code/game/objects/objs.dm index b8636d6cb603..8baeb973337b 100644 --- a/code/game/objects/objs.dm +++ b/code/game/objects/objs.dm @@ -366,15 +366,6 @@ return ..() -/obj/bullet_act(obj/projectile/P) - //Tasers and the like should not damage objects. - if(P.ammo.damage_type == HALLOSS || P.ammo.damage_type == TOX || P.ammo.damage_type == CLONE || P.damage == 0) - return 0 - bullet_ping(P) - if(P.ammo.damage) - update_health(floor(P.ammo.damage / 2)) - return 1 - /obj/item/proc/get_mob_overlay(mob/user_mob, slot, default_bodytype = "Default") var/bodytype = default_bodytype var/mob/living/carbon/human/user_human diff --git a/code/game/objects/structures/crates_lockers/closets/phonebox.dm b/code/game/objects/structures/crates_lockers/closets/phonebox.dm index 9dcd05b439cf..c4bc90368cd9 100644 --- a/code/game/objects/structures/crates_lockers/closets/phonebox.dm +++ b/code/game/objects/structures/crates_lockers/closets/phonebox.dm @@ -96,7 +96,7 @@ update_icon() flags_atom |= USES_HEARING -/obj/structure/machinery/recharge_station/Destroy() +/obj/structure/machinery/phonebox/Destroy() if(occupant) to_chat(occupant, SPAN_NOTICE(" [name] colapses around you.")) go_out() diff --git a/code/game/objects/structures/pipes/trinary_misc.dm b/code/game/objects/structures/pipes/trinary_misc.dm index cd2ef243a73c..fe3eda4ced77 100644 --- a/code/game/objects/structures/pipes/trinary_misc.dm +++ b/code/game/objects/structures/pipes/trinary_misc.dm @@ -56,7 +56,7 @@ dir = SOUTH valid_directions = list(SOUTH, NORTH, EAST) -/obj/structure/pipes/trinary/filter/update_icon() +/obj/structure/pipes/trinary/filter/m_filter/update_icon() if(length(connected_to)) icon_state = "mon" else @@ -138,7 +138,7 @@ dir = SOUTH valid_directions = list(SOUTH, NORTH, EAST) -/obj/structure/pipes/trinary/mixer/t_mixer/update_icon() +/obj/structure/pipes/trinary/mixer/m_mixer/update_icon() if(length(connected_to)) icon_state = "mon" else diff --git a/code/game/objects/structures/props/requests_console.dm b/code/game/objects/structures/props/requests_console.dm index 7c4dd0b42992..a2e50a67632a 100644 --- a/code/game/objects/structures/props/requests_console.dm +++ b/code/game/objects/structures/props/requests_console.dm @@ -5,10 +5,6 @@ icon = 'icons/obj/structures/machinery/terminals.dmi' icon_state = "req_comp0" -/obj/structure/machinery/requests_console/power_change() - ..() - update_icon() - /obj/structure/machinery/requests_console/update_icon() if(stat & NOPOWER) if(icon_state != "req_comp_off") diff --git a/code/game/objects/structures/reagent_dispensers.dm b/code/game/objects/structures/reagent_dispensers.dm index 0452b4169664..24b95e600ef2 100644 --- a/code/game/objects/structures/reagent_dispensers.dm +++ b/code/game/objects/structures/reagent_dispensers.dm @@ -80,18 +80,6 @@ healthcheck() return TRUE -/obj/structure/reagent_dispensers/attack_alien(mob/living/carbon/xenomorph/user) - if(unslashable) - return XENO_NO_DELAY_ACTION - user.animation_attack_on(src) - health -= (rand(user.melee_damage_lower, user.melee_damage_upper)) - playsound(src, 'sound/effects/metalhit.ogg', 25, 1) - user.visible_message(SPAN_DANGER("[user] slashes \the [src]!"), \ - SPAN_DANGER("You slash \the [src]!"), null, 5, CHAT_TYPE_XENO_COMBAT) - healthcheck() - return XENO_ATTACK_ACTION - - /obj/structure/reagent_dispensers/verb/set_transfer_direction() //set amount_per_transfer_from_this set name = "Set transfer direction" set category = "Object" diff --git a/code/game/objects/structures/stool_bed_chair_nest/bed.dm b/code/game/objects/structures/stool_bed_chair_nest/bed.dm index 8bbca23fbb80..a8d50b5bf2fb 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/bed.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/bed.dm @@ -30,8 +30,7 @@ surgery_duration_multiplier = SURGERY_SURFACE_MULT_UNSUITED /obj/structure/bed/initialize_pass_flags(datum/pass_flags_container/PF) - ..() - if (PF) + if(PF) PF.flags_can_pass_all = PASS_OVER|PASS_AROUND|PASS_UNDER /obj/structure/bed/update_icon() diff --git a/code/game/objects/structures/stool_bed_chair_nest/chairs.dm b/code/game/objects/structures/stool_bed_chair_nest/chairs.dm index 70b59cafb4b9..a8ee05ae3416 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/chairs.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/chairs.dm @@ -20,9 +20,8 @@ if(!can_rotate) verbs.Remove(/obj/structure/bed/chair/verb/rotate) -/obj/structure/bed/initialize_pass_flags(datum/pass_flags_container/PF) - ..() - if (PF) +/obj/structure/bed/chair/initialize_pass_flags(datum/pass_flags_container/PF) + if(PF) PF.flags_can_pass_all = PASS_AROUND|PASS_UNDER flags_can_pass_all_temp = PASS_OVER @@ -446,7 +445,7 @@ chair_state = DROPSHIP_CHAIR_UNFOLDED icon_state = "hotseat" -/obj/structure/bed/chair/dropship/passenger/buckle_mob(mob/living/M, mob/living/user) +/obj/structure/bed/chair/dropship/passenger/shuttle_chair/buckle_mob(mob/living/M, mob/living/user) if(chair_state != DROPSHIP_CHAIR_UNFOLDED) return ..() diff --git a/code/game/turfs/floor.dm b/code/game/turfs/floor.dm index 55e1fde8f41e..ad7670a33da8 100644 --- a/code/game/turfs/floor.dm +++ b/code/game/turfs/floor.dm @@ -30,7 +30,7 @@ . += SPAN_NOTICE("\The [src] can be removed with \a [english_list(tool_output)].") -/turf/open/floor/plating/is_plasteel_floor() +/turf/open/floor/is_plasteel_floor() return TRUE //////////////////////////////////////////// diff --git a/code/game/turfs/floor_types.dm b/code/game/turfs/floor_types.dm index f7393950cfb2..d35fe530947f 100644 --- a/code/game/turfs/floor_types.dm +++ b/code/game/turfs/floor_types.dm @@ -933,6 +933,9 @@ icon = 'icons/turf/floors/aicore.dmi' icon_state = "ai_floor1" +/turf/open/floor/almayer/aicore/is_plasteel_floor() + return FALSE + /turf/open/floor/almayer/aicore/glowing icon_state = "ai_floor2" light_color = "#d69c46" @@ -1114,6 +1117,9 @@ name = "ice colony floor" plating_type = /turf/open/floor/plating/icefloor +/turf/open/floor/icefloor/is_plasteel_floor() + return FALSE + /turf/open/floor/icefloor/shuttle_floor6 icon = 'icons/turf/shuttle.dmi' icon_state = "floor6" diff --git a/code/game/turfs/hybrisa.dm b/code/game/turfs/hybrisa.dm index dc0ad8102200..edea2a32aaa5 100644 --- a/code/game/turfs/hybrisa.dm +++ b/code/game/turfs/hybrisa.dm @@ -10,6 +10,9 @@ icon = 'icons/turf/floors/hybrisafloors.dmi' icon_state = "hybrisa" +/turf/open/floor/hybrisa/is_plasteel_floor() + return FALSE + /turf/open/floor/plating/engineer_ship icon = 'icons/turf/floors/engineership.dmi' burnable_tile = FALSE diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index 0082cb6ae0ae..105524d2ea70 100644 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -63,6 +63,9 @@ ///Lazylist of movable atoms providing opacity sources. var/list/atom/movable/opacity_sources + ///hybrid lights affecting this turf + var/tmp/list/atom/movable/lighting_mask/hybrid_lights_affecting + /turf/Initialize(mapload) SHOULD_CALL_PARENT(FALSE) // this doesn't parent call for optimisation reasons if(flags_atom & INITIALIZED) @@ -104,6 +107,11 @@ return INITIALIZE_HINT_NORMAL /turf/Destroy(force) + if(hybrid_lights_affecting) + for(var/atom/movable/lighting_mask/mask as anything in hybrid_lights_affecting) + LAZYREMOVE(mask.affecting_turfs, src) + hybrid_lights_affecting.Cut() + . = QDEL_HINT_IWILLGC if(!changing_turf) stack_trace("Incorrect turf deletion") diff --git a/code/modules/almayer/machinery.dm b/code/modules/almayer/machinery.dm index f39d101a3cd0..510571cbd0e7 100644 --- a/code/modules/almayer/machinery.dm +++ b/code/modules/almayer/machinery.dm @@ -45,10 +45,6 @@ stat |= BROKEN update_icon() -/obj/structure/machinery/prop/almayer/computer/power_change() - ..() - update_icon() - /obj/structure/machinery/prop/almayer/computer/update_icon() ..() icon_state = initial(icon_state) diff --git a/code/modules/assembly/holder.dm b/code/modules/assembly/holder.dm index ef731e2dd73b..9aa07665a911 100644 --- a/code/modules/assembly/holder.dm +++ b/code/modules/assembly/holder.dm @@ -29,16 +29,30 @@ flags_atom |= USES_HEARING /obj/item/device/assembly_holder/proc/attach_special(obj/O, mob/user) - return + if(!O) + return FALSE + if(!O.IsSpecialAssembly()) + return FALSE -/obj/item/device/assembly_holder/proc/process_activation(obj/item/device/D) - return +/obj/item/device/assembly_holder/proc/process_activation(obj/item/device/D, normal = TRUE, special = TRUE) + if(!D) + return FALSE + if(!secured) + visible_message("[icon2html(src, hearers(src))] *beep* *beep*", "*beep* *beep*") + if((normal) && (a_right) && (a_left)) + if(a_right != D) + a_right.pulsed(0) + if(a_left && a_left != D) //check a_left again, a_right.pulsed() might've qdel'd the assembly + a_left.pulsed(0) + if(master) + master.receive_signal() + return TRUE /obj/item/device/assembly_holder/proc/detached() return /obj/item/device/assembly_holder/IsAssemblyHolder() - return 1 + return TRUE /obj/item/device/assembly_holder/proc/attach(obj/item/device/D, obj/item/device/D2, mob/user) if((!D)||(!D2)) return 0 @@ -64,10 +78,6 @@ return 1 -/obj/item/device/assembly_holder/attach_special(obj/O, mob/user) - if(!O) return - if(!O.IsSpecialAssembly()) return 0 - /obj/item/device/assembly_holder/update_icon() overlays.Cut() if(a_left) @@ -182,19 +192,6 @@ a_right = null qdel(src) -/obj/item/device/assembly_holder/process_activation(obj/D, normal = 1, special = 1) - if(!D) return 0 - if(!secured) - visible_message("[icon2html(src, hearers(src))] *beep* *beep*", "*beep* *beep*") - if((normal) && (a_right) && (a_left)) - if(a_right != D) - a_right.pulsed(0) - if(a_left && a_left != D) //check a_left again, a_right.pulsed() might've qdel'd the assembly - a_left.pulsed(0) - if(master) - master.receive_signal() - return 1 - /obj/item/device/assembly_holder/hear_talk(mob/living/M as mob, msg) if(a_right) a_right.hear_talk(M,msg) diff --git a/code/modules/assembly/infrared.dm b/code/modules/assembly/infrared.dm index 66746301a6e7..c7add2af5ab0 100644 --- a/code/modules/assembly/infrared.dm +++ b/code/modules/assembly/infrared.dm @@ -200,6 +200,9 @@ return /obj/effect/beam/i_beam/Destroy() + if(master) + master = null + QDEL_NULL(next) STOP_PROCESSING(SSobj, src) . = ..() @@ -258,12 +261,3 @@ return spawn(0) hit() - return - return - -/obj/effect/beam/i_beam/Destroy() - if(master) - master = null - QDEL_NULL(next) - . = ..() - diff --git a/code/modules/clans/client.dm b/code/modules/clans/client.dm index b31a2c06f9c9..14f9ea6c466d 100644 --- a/code/modules/clans/client.dm +++ b/code/modules/clans/client.dm @@ -1,22 +1,3 @@ -/client - var/datum/entity/clan_player/clan_info - -/client/load_player_data_info(datum/entity/player/player) - set waitfor = FALSE - - . = ..() - if(GLOB.RoleAuthority && check_whitelist_status(WHITELIST_PREDATOR)) - clan_info = GET_CLAN_PLAYER(player.id) - clan_info.sync() - - if(check_whitelist_status(WHITELIST_YAUTJA_LEADER)) - clan_info.clan_rank = GLOB.clan_ranks_ordered[CLAN_RANK_ADMIN] - clan_info.permissions |= CLAN_PERMISSION_ALL - else - clan_info.permissions &= ~CLAN_PERMISSION_ADMIN_MANAGER // Only the leader can manage the ancients - - clan_info.save() - /client/proc/usr_create_new_clan() set name = "Create New Clan" set category = "Debug" diff --git a/code/modules/client/client_procs.dm b/code/modules/client/client_procs.dm index 4364fc8a5959..a299eac56230 100644 --- a/code/modules/client/client_procs.dm +++ b/code/modules/client/client_procs.dm @@ -445,6 +445,10 @@ GLOBAL_LIST_INIT(whitelisted_client_procs, list( SEND_GLOBAL_SIGNAL(COMSIG_GLOB_CLIENT_LOGGED_IN, src) + if(CONFIG_GET(flag/ooc_country_flags)) + spawn if(src) + ip2country(address, src) + ////////////// //DISCONNECT// ////////////// diff --git a/code/modules/client/country_flags.dm b/code/modules/client/country_flags.dm index d72f0fbd5a98..257186af09ab 100644 --- a/code/modules/client/country_flags.dm +++ b/code/modules/client/country_flags.dm @@ -1,9 +1,3 @@ -/client/New() - . = ..() - if(CONFIG_GET(flag/ooc_country_flags)) - spawn if(src) - ip2country(address, src) - /proc/ip2country(ipaddr, client/origin) if(!origin || origin?.country) return //null source, or already has a flag diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index 994e77ec3f2f..c9831c91b0ea 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -44,8 +44,18 @@ return /obj/item/clothing/attack_hand(mob/user as mob) - if(drag_unequip && ishuman(usr) && src.loc == user) //make it harder to accidentally undress yourself + //only forward to the attached accessory if the clothing is equipped (not in a storage) + if(LAZYLEN(accessories) && loc == user) + var/delegated //So that accessories don't block attack_hands unless they actually did something. Specifically meant for armor vests with medals, but can't hurt in general. + for(var/obj/item/clothing/accessory/A in accessories) + if(A.attack_hand(user)) + delegated = TRUE + if(delegated) + return + + if(drag_unequip && ishuman(usr) && loc == user) //make it harder to accidentally undress yourself return + ..() /obj/item/clothing/hear_talk(mob/M, msg) @@ -459,6 +469,11 @@ return null /obj/item/clothing/clicked(mob/user, list/mods) + if(mods["alt"] && loc == user && !user.get_active_hand()) //To pass quick-draw attempts to storage. See storage.dm for explanation. + for(var/V in verbs) + if(V == /obj/item/clothing/suit/storage/verb/toggle_draw_mode) //So that alt-clicks are only intercepted for clothing items with internal storage and toggleable draw modes. + return + var/obj/item/storage/internal/pockets = get_pockets() if(pockets && !mods["shift"] && mods["middle"] && CAN_PICKUP(user, src)) pockets.open(user) diff --git a/code/modules/clothing/clothing_accessories.dm b/code/modules/clothing/clothing_accessories.dm index cfc861655528..ccda7c1b7d33 100644 --- a/code/modules/clothing/clothing_accessories.dm +++ b/code/modules/clothing/clothing_accessories.dm @@ -71,26 +71,6 @@ ..() -/obj/item/clothing/attack_hand(mob/user, mods) - //only forward to the attached accessory if the clothing is equipped (not in a storage) - if(LAZYLEN(accessories) && src.loc == user) - var/delegated //So that accessories don't block attack_hands unless they actually did something. Specifically meant for armor vests with medals, but can't hurt in general. - for(var/obj/item/clothing/accessory/A in accessories) - if(A.attack_hand(user, mods)) - delegated = TRUE - if(delegated) - return - return ..() - - -/obj/item/clothing/clicked(mob/user, list/mods) - if(mods["alt"] && loc == user && !user.get_active_hand()) //To pass quick-draw attempts to storage. See storage.dm for explanation. - for(var/V in verbs) - if(V == /obj/item/clothing/suit/storage/verb/toggle_draw_mode) //So that alt-clicks are only intercepted for clothing items with internal storage and toggleable draw modes. - return - . = ..() - - /obj/item/clothing/get_examine_text(mob/user) . = ..() for(var/obj/item/clothing/accessory/A in accessories) diff --git a/code/modules/clothing/head/helmet.dm b/code/modules/clothing/head/helmet.dm index e8225a48c76f..d1b7aa8176ba 100644 --- a/code/modules/clothing/head/helmet.dm +++ b/code/modules/clothing/head/helmet.dm @@ -560,12 +560,15 @@ GLOBAL_LIST_INIT(allowed_helmet_items, list( /obj/item/clothing/head/helmet/marine/equipped(mob/living/carbon/human/mob, slot) if(camera) camera.c_tag = mob.name + camera.status = TRUE if(active_visor) recalculate_visors(mob) ..() /obj/item/clothing/head/helmet/marine/unequipped(mob/user, slot) . = ..() + if(camera) + camera.status = FALSE if(pockets) for(var/obj/item/attachable/flashlight/F in pockets) if(F.light_on) @@ -696,16 +699,6 @@ GLOBAL_LIST_INIT(allowed_helmet_items, list( /obj/item/clothing/head/helmet/marine/see_emote(mob/living/sourcemob, emote, audible) SEND_SIGNAL(src, COMSIG_BROADCAST_SEE_EMOTE, sourcemob, emote, audible, loc == sourcemob && audible) -/obj/item/clothing/head/helmet/marine/equipped(mob/living/carbon/human/mob, slot) - . = ..() - if(camera) - camera.status = TRUE - -/obj/item/clothing/head/helmet/marine/unequipped(mob/user, slot) - . = ..() - if(camera) - camera.status = FALSE - /datum/action/item_action/cycle_helmet_huds/New(Target, obj/item/holder) . = ..() name = "Cycle helmet HUD" diff --git a/code/modules/cm_aliens/structures/trap.dm b/code/modules/cm_aliens/structures/trap.dm index 297dd5ff2e0f..482e61184fff 100644 --- a/code/modules/cm_aliens/structures/trap.dm +++ b/code/modules/cm_aliens/structures/trap.dm @@ -32,14 +32,11 @@ if(hivenumber == XENO_HIVE_NORMAL) RegisterSignal(SSdcs, COMSIG_GLOB_GROUNDSIDE_FORSAKEN_HANDLING, PROC_REF(forsaken_handling)) -/obj/effect/alien/resin/trap/Initialize() - . = ..() - - var/obj/effect/alien/weeds/node/WD = locate() in loc - if(WD) - WD.RegisterSignal(src, COMSIG_PARENT_PREQDELETED, /obj/effect/alien/weeds/node/proc/trap_destroyed) - WD.overlay_node = FALSE - WD.overlays.Cut() + var/obj/effect/alien/weeds/node/weed = locate() in loc + if(weed) + weed.RegisterSignal(src, COMSIG_PARENT_PREQDELETED, /obj/effect/alien/weeds/node/proc/trap_destroyed) + weed.overlay_node = FALSE + weed.overlays.Cut() /obj/effect/alien/resin/trap/get_examine_text(mob/user) if(!isxeno(user)) diff --git a/code/modules/cm_marines/Donator_Items.dm b/code/modules/cm_marines/Donator_Items.dm index e17ce3fe53af..94036baf7899 100644 --- a/code/modules/cm_marines/Donator_Items.dm +++ b/code/modules/cm_marines/Donator_Items.dm @@ -21,7 +21,7 @@ min_cold_protection_temperature = ICE_PLANET_MIN_COLD_PROT flags_marine_helmet = NO_FLAGS -/obj/item/clothing/suit/storage/marine/light/fluff/Initialize(mapload) +/obj/item/clothing/head/helmet/marine/fluff/Initialize(mapload) . = ..() item_icons[WEAR_HEAD] = 'icons/mob/humans/onmob/clothing/head/donator.dmi' diff --git a/code/modules/cm_marines/anti_air.dm b/code/modules/cm_marines/anti_air.dm index 3c69a0fe241a..572e3f9289d2 100644 --- a/code/modules/cm_marines/anti_air.dm +++ b/code/modules/cm_marines/anti_air.dm @@ -119,17 +119,11 @@ GLOBAL_DATUM(almayer_aa_cannon, /obj/structure/anti_air_cannon) add_fingerprint(usr) - -/obj/structure/machinery/computer/aa_console/attack_hand(mob/user) - . = ..() - tgui_interact(user) - - // based on big copypasta from the orbital console // the obvious improvement here is to port to nanoui but i'm too lazy to do that from the get go /obj/structure/machinery/computer/aa_console/attack_hand(mob/user) if(..()) - return + return TRUE if(!skillcheck(user, SKILL_ENGINEER, SKILL_ENGINEER_TRAINED)) to_chat(user, SPAN_WARNING("You have no idea how to use that console.")) @@ -138,3 +132,6 @@ GLOBAL_DATUM(almayer_aa_cannon, /obj/structure/anti_air_cannon) if(!allowed(user)) to_chat(user, SPAN_WARNING("You do not have access to this.")) return TRUE + + tgui_interact(user) + return TRUE diff --git a/code/modules/cm_marines/orbital_cannon.dm b/code/modules/cm_marines/orbital_cannon.dm index 2e0aaa07db46..f73fedaf13da 100644 --- a/code/modules/cm_marines/orbital_cannon.dm +++ b/code/modules/cm_marines/orbital_cannon.dm @@ -613,7 +613,7 @@ GLOBAL_LIST_EMPTY(orbital_cannon_cancellation) ui = new(user, src, "OrbitalCannonConsole", "[src.name]") ui.open() -/obj/structure/machinery/computer/aa_console/ui_state(mob/user) +/obj/structure/machinery/computer/orbital_cannon_console/ui_state(mob/user) return GLOB.not_incapacitated_and_adjacent_state /obj/structure/machinery/computer/orbital_cannon_console/ui_status(mob/user, datum/ui_state/state) diff --git a/code/modules/cm_marines/smartgun_mount.dm b/code/modules/cm_marines/smartgun_mount.dm index 2efcb2e70adc..e22b6ca56bef 100644 --- a/code/modules/cm_marines/smartgun_mount.dm +++ b/code/modules/cm_marines/smartgun_mount.dm @@ -515,10 +515,6 @@ /// How long between semi-auto shots this should wait, to reduce possible spam var/semiauto_cooldown_time = 0.2 SECONDS -/obj/structure/machinery/m56d_hmg/get_examine_text(mob/user) - . = ..() - . += "It is currently set to [gun_firemode]." - /obj/structure/machinery/m56d_hmg/initialize_pass_flags(datum/pass_flags_container/PF) ..() if (PF) @@ -567,6 +563,7 @@ /obj/structure/machinery/m56d_hmg/get_examine_text(mob/user) //Let us see how much ammo we got in this thing. . = ..() if(ishuman(user) || HAS_TRAIT(user, TRAIT_OPPOSABLE_THUMBS)) + . += "It is currently set to [gun_firemode]." if(rounds) . += SPAN_NOTICE("It has [rounds] round\s out of [rounds_max].") else diff --git a/code/modules/cm_tech/implements/armor.dm b/code/modules/cm_tech/implements/armor.dm index 51c2499f6972..e8829427ca26 100644 --- a/code/modules/cm_tech/implements/armor.dm +++ b/code/modules/cm_tech/implements/armor.dm @@ -217,15 +217,11 @@ /obj/item/clothing/accessory/health/research_plate/on_attached(obj/item/clothing/attached_to, mob/living/carbon/human/user) . = ..() attached_uni = attached_to + RegisterSignal(user, COMSIG_MOB_ITEM_UNEQUIPPED, PROC_REF(on_removed_sig)) /obj/item/clothing/accessory/health/research_plate/proc/can_recycle(mob/living/user) //override this proc for check if you can recycle the plate. return FALSE - -/obj/item/clothing/accessory/health/research_plate/on_attached(obj/item/clothing/S, mob/living/carbon/human/user) - . = ..() - RegisterSignal(user, COMSIG_MOB_ITEM_UNEQUIPPED, PROC_REF(on_removed_sig)) - /obj/item/clothing/accessory/health/research_plate/on_removed(mob/living/user, obj/item/clothing/C) . = ..() UnregisterSignal(user, COMSIG_MOB_ITEM_UNEQUIPPED) diff --git a/code/modules/cm_tech/trees/marine.dm b/code/modules/cm_tech/trees/marine.dm index 046712f9656b..5ab2b7eaa36e 100644 --- a/code/modules/cm_tech/trees/marine.dm +++ b/code/modules/cm_tech/trees/marine.dm @@ -147,28 +147,6 @@ GLOBAL_LIST_EMPTY(tech_controls_marine) var/datum/techtree/tree = GET_TREE(TREE_MARINE) tree.enter_mob(usr, FALSE) -/obj/structure/machinery/computer/view_objectives - name = "Intel Database Computer" - desc = "An USCM Intel Computer for consulting the current Intel database." - icon_state = "terminal1_old" - unslashable = TRUE - unacidable = TRUE - - -/obj/structure/machinery/computer/view_objectives/attack_hand(mob/living/user) - if(!user || !istype(user) || !user.mind || !user.mind.objective_memory) - return FALSE - if(!powered()) - to_chat(user, SPAN_WARNING("This computer has no power!")) - return FALSE - if(!GLOB.intel_system) - to_chat(user, SPAN_WARNING("The computer doesn't seem to be connected to anything...")) - return FALSE - if(user.action_busy) - return FALSE - - user.mind.view_objective_memories(src) - /datum/techtree/marine/on_tier_change(datum/tier/oldtier) if(tier.tier < 2) return //No need to announce tier updates for tier 1 diff --git a/code/modules/defenses/defenses.dm b/code/modules/defenses/defenses.dm index fef8498f802a..f62b567d6da6 100644 --- a/code/modules/defenses/defenses.dm +++ b/code/modules/defenses/defenses.dm @@ -50,7 +50,12 @@ connect() /obj/structure/machinery/defenses/Destroy() - if(!QDESTROYING(HD)) + owner_mob = null + HD = null // FIXME: Might also need to delete. Unsure. + if(linked_laptop) + linked_laptop.unpair_sentry(src) + linked_laptop = null + if(!QDELETED(HD)) QDEL_NULL(HD) return ..() @@ -470,15 +475,6 @@ /obj/structure/machinery/defenses/power_change() return -/obj/structure/machinery/defenses/Destroy() - if(owner_mob) - owner_mob = null - HD = null // FIXME: Might also need to delete. Unsure. - if(linked_laptop) - linked_laptop.unpair_sentry(src) - linked_laptop = null - . = ..() - /obj/structure/machinery/defenses/verb/toggle_turret_locks_verb() set name = "Toggle Turret Lock" set desc = "Toggles allowing non-engineers to turn turrets on and off" diff --git a/code/modules/defenses/planted_flag.dm b/code/modules/defenses/planted_flag.dm index 40db224f8e7f..68ebeda8a9d9 100644 --- a/code/modules/defenses/planted_flag.dm +++ b/code/modules/defenses/planted_flag.dm @@ -160,12 +160,11 @@ var/area_range = PLANTED_FLAG_RANGE-2 var/buff_intensity = PLANTED_FLAG_BUFF/2 -/obj/item/storage/backpack/equipped(mob/user, slot) +/obj/item/storage/backpack/jima/equipped(mob/user, slot) . = ..() if(slot == WEAR_BACK) START_PROCESSING(SSobj, src) - /obj/item/storage/backpack/jima/process() if(!ismob(loc)) STOP_PROCESSING(SSobj, src) diff --git a/code/modules/desert_dam/filtration/structures.dm b/code/modules/desert_dam/filtration/structures.dm index 86d7013ee8a0..a7da3b6c9809 100644 --- a/code/modules/desert_dam/filtration/structures.dm +++ b/code/modules/desert_dam/filtration/structures.dm @@ -3,6 +3,9 @@ icon = 'icons/turf/floors/filtration.dmi' icon_state = "filtrationside" +/turf/open/floor/filtrationside/is_plasteel_floor() + return FALSE + /turf/open/floor/filtrationside/southwest dir = SOUTHWEST @@ -36,6 +39,9 @@ icon = 'icons/turf/floors/coagulation.dmi' icon_state = null +/turf/open/floor/coagulation/is_plasteel_floor() + return FALSE + /turf/open/floor/coagulation/icon0_0 icon_state = "0,0" diff --git a/code/modules/desert_dam/motion_sensor/sensortower.dm b/code/modules/desert_dam/motion_sensor/sensortower.dm index 666a3bc60cd8..373dd2692963 100644 --- a/code/modules/desert_dam/motion_sensor/sensortower.dm +++ b/code/modules/desert_dam/motion_sensor/sensortower.dm @@ -233,10 +233,6 @@ SPAN_DANGER("You stop destroying \the [src]'s internal machinery!"), null, 5, CHAT_TYPE_XENO_COMBAT) return XENO_NO_DELAY_ACTION -/obj/structure/machinery/sensortower/power_change() - ..() - update_icon() - /* Decreases the buildstate of the sensor tower and switches it off if affected by any explosion. Higher severity explosion will damage the sensor tower more */ diff --git a/code/modules/gear_presets/colonist.dm b/code/modules/gear_presets/colonist.dm index 5e42cb9aee5d..e9eefe2620ab 100644 --- a/code/modules/gear_presets/colonist.dm +++ b/code/modules/gear_presets/colonist.dm @@ -20,7 +20,7 @@ new_human.equip_to_slot(new /obj/item/attachable/bayonet(new_human), WEAR_L_STORE) new_human.equip_to_slot(new /obj/item/device/flashlight(new_human), WEAR_R_STORE) -/datum/equipment_preset/survivor/load_id(mob/living/carbon/human/new_human, client/mob_client) +/datum/equipment_preset/colonist/load_id(mob/living/carbon/human/new_human, client/mob_client) var/obj/item/clothing/under/uniform = new_human.w_uniform if(istype(uniform)) uniform.has_sensor = UNIFORM_HAS_SENSORS diff --git a/code/modules/gear_presets/corpses.dm b/code/modules/gear_presets/corpses.dm index 80a1d76500e1..9cae4d3ede28 100644 --- a/code/modules/gear_presets/corpses.dm +++ b/code/modules/gear_presets/corpses.dm @@ -461,7 +461,7 @@ /datum/equipment_preset/corpse/colonist name = "Corpse - Colonist" -/datum/equipment_preset/colonist/load_gear(mob/living/carbon/human/new_human) +/datum/equipment_preset/corpse/colonist/load_gear(mob/living/carbon/human/new_human) add_ice_colony_survivor_equipment(new_human) new_human.equip_to_slot_or_del(new /obj/item/clothing/under/colonist(new_human), WEAR_BODY) new_human.equip_to_slot_or_del(new /obj/item/device/radio/headset/distress(new_human), WEAR_L_EAR) diff --git a/code/modules/gear_presets/synths.dm b/code/modules/gear_presets/synths.dm index 3ccae70e662c..fefcae3b19c8 100644 --- a/code/modules/gear_presets/synths.dm +++ b/code/modules/gear_presets/synths.dm @@ -32,13 +32,6 @@ final_name = "David" new_human.change_real_name(new_human, final_name) -/datum/equipment_preset/synth/load_skills(mob/living/carbon/human/new_human) - . = ..() - if(iscolonysynthetic(new_human) && !isworkingjoe(new_human)) - new_human.set_skills(/datum/skills/colonial_synthetic) - - new_human.allow_gun_usage = FALSE - /datum/equipment_preset/synth/load_skills(mob/living/carbon/human/new_human, client/mob_client) new_human.allow_gun_usage = FALSE @@ -748,7 +741,7 @@ . = ..() new_human.allow_gun_usage = TRUE -/datum/equipment_preset/synth/working_joe/load_race(mob/living/carbon/human/new_human) +/datum/equipment_preset/synth/working_joe/upp/load_race(mob/living/carbon/human/new_human) . = ..() new_human.set_species(joe_type) new_human.h_style = "Bald" diff --git a/code/modules/gear_presets/uscm_forecon.dm b/code/modules/gear_presets/uscm_forecon.dm index 09ab64c75f18..ff0c3aa6b58d 100644 --- a/code/modules/gear_presets/uscm_forecon.dm +++ b/code/modules/gear_presets/uscm_forecon.dm @@ -94,10 +94,10 @@ var/obj/item/clothing/accessory/ranks/marine/e5/pin = new() var/obj/item/clothing/accessory/patch/patch_uscm = new() var/obj/item/clothing/accessory/patch/forecon/patch_forecon = new() - uniform.attach_accessory(new_human,pouch) - uniform.attach_accessory(new_human,patch_uscm) - uniform.attach_accessory(new_human,pin) - uniform.attach_accessory(new_human,patch_forecon) + uniform.attach_accessory(new_human, pouch) + uniform.attach_accessory(new_human, patch_uscm) + uniform.attach_accessory(new_human, pin) + uniform.attach_accessory(new_human, patch_forecon) new_human.equip_to_slot_or_del(uniform, WEAR_BODY) new_human.equip_to_slot_or_del(new /obj/item/clothing/suit/storage/marine/light/recon(new_human), WEAR_JACKET) new_human.equip_to_slot_or_del(new /obj/item/storage/backpack/marine/satchel(new_human), WEAR_BACK) @@ -112,8 +112,6 @@ new_human.equip_to_slot_or_del(new /obj/item/device/radio/headset/distress/forecon(new_human), WEAR_L_EAR) GLOB.character_traits[/datum/character_trait/skills/spotter].apply_trait(new_human) -/datum/equipment_preset/uscm/forecon/standard/load_gear(mob/living/carbon/human/new_human) - ..() new_human.equip_to_slot_or_del(new /obj/item/storage/pouch/firstaid/full/alternate(new_human), WEAR_L_STORE) spawn_random_headgear(new_human) add_forecon_weapon_pistol(new_human) diff --git a/code/modules/lighting/lighting_mask/lighting_mask.dm b/code/modules/lighting/lighting_mask/lighting_mask.dm index c1276d19dab0..e02184d9925f 100644 --- a/code/modules/lighting/lighting_mask/lighting_mask.dm +++ b/code/modules/lighting/lighting_mask/lighting_mask.dm @@ -33,12 +33,34 @@ ///Set to TRUE if you want the light to rotate with the owner var/is_directional = FALSE + ///Turfs that are being affected by this mask, this is for the sake of luminosity + var/list/turf/affecting_turfs + ///list of mutable appearance shadows + var/list/mutable_appearance/shadows + var/times_calculated = 0 + + //Please dont change these + var/calculated_position_x + var/calculated_position_y + /atom/movable/lighting_mask/Initialize(mapload, ...) . = ..() add_filter("pixel_smoother", 3, gauss_blur_filter(2)) add_filter("shadow_alpha_masking", 4, alpha_mask_filter(render_source = SHADOW_RENDER_TARGET, flags = MASK_INVERSE)) /atom/movable/lighting_mask/Destroy() + //Make sure we werent destroyed in init + SSlighting.mask_queue -= src + //Remove from affecting turfs + if(affecting_turfs) + for(var/turf/thing as anything in affecting_turfs) + var/area/A = thing.loc + LAZYREMOVE(thing.hybrid_lights_affecting, src) + if(!A.base_lighting_alpha) + thing.luminosity -= 1 + affecting_turfs = null + //Cut the shadows. Since they are overlays they will be deleted when cut from overlays. + LAZYCLEARLIST(shadows) mask_holder = null attached_atom = null return ..() diff --git a/code/modules/lighting/lighting_mask/shadow_calculator.dm b/code/modules/lighting/lighting_mask/shadow_calculator.dm index 480b4d534fbb..08ab8be07e8c 100644 --- a/code/modules/lighting/lighting_mask/shadow_calculator.dm +++ b/code/modules/lighting/lighting_mask/shadow_calculator.dm @@ -33,32 +33,6 @@ #define DO_SOMETHING_IF_DEBUGGING_SHADOWS(something) #endif -/atom/movable/lighting_mask - ///Turfs that are being affected by this mask, this is for the sake of luminosity - var/list/turf/affecting_turfs - ///list of mutable appearance shadows - var/list/mutable_appearance/shadows - var/times_calculated = 0 - - //Please dont change these - var/calculated_position_x - var/calculated_position_y - -/atom/movable/lighting_mask/Destroy() - //Make sure we werent destroyed in init - SSlighting.mask_queue -= src - //Remove from affecting turfs - if(affecting_turfs) - for(var/turf/thing as anything in affecting_turfs) - var/area/A = thing.loc - LAZYREMOVE(thing.hybrid_lights_affecting, src) - if(!A.base_lighting_alpha) - thing.luminosity -= 1 - affecting_turfs = null - //Cut the shadows. Since they are overlays they will be deleted when cut from overlays. - LAZYCLEARLIST(shadows) - return ..() - /atom/movable/lighting_mask/proc/link_turf_to_light(turf/T) LAZYOR(affecting_turfs, T) LAZYOR(T.hybrid_lights_affecting, src) diff --git a/code/modules/lighting/lighting_turf.dm b/code/modules/lighting/lighting_turf.dm index c1fb288e9dd2..40fc863f42b5 100644 --- a/code/modules/lighting/lighting_turf.dm +++ b/code/modules/lighting/lighting_turf.dm @@ -3,17 +3,6 @@ ///Used for lightig mask lumcount calculations #define LIGHT_POWER_ESTIMATION(alpha, range, distance) max((alpha * (range - distance)) / (255 * range), 0) -/turf - ///hybrid lights affecting this turf - var/tmp/list/atom/movable/lighting_mask/hybrid_lights_affecting - -/turf/Destroy(force) - if(hybrid_lights_affecting) - for(var/atom/movable/lighting_mask/mask as anything in hybrid_lights_affecting) - LAZYREMOVE(mask.affecting_turfs, src) - hybrid_lights_affecting.Cut() - return ..() - /// Causes any affecting light sources to be queued for a visibility update, for example a door got opened. /turf/proc/reconsider_lights() //Consider static lights diff --git a/code/modules/mob/living/carbon/human/human_abilities.dm b/code/modules/mob/living/carbon/human/human_abilities.dm index 49663ab43e98..719945c1140b 100644 --- a/code/modules/mob/living/carbon/human/human_abilities.dm +++ b/code/modules/mob/living/carbon/human/human_abilities.dm @@ -153,7 +153,7 @@ name = "Psychic Radiance" action_icon_state = "cultist_channel_hivemind" -/datum/action/xeno_action/onclick/psychic_radiance/use_ability(atom/A) +/datum/action/xeno_action/psychic_radiance/use_ability(atom/A) . = ..() if(!ishuman(owner)) return FALSE diff --git a/code/modules/mob/logout.dm b/code/modules/mob/logout.dm index 839645f1084c..c40221ecbe3a 100644 --- a/code/modules/mob/logout.dm +++ b/code/modules/mob/logout.dm @@ -1,5 +1,6 @@ /mob/Logout() SEND_SIGNAL(src, COMSIG_MOB_LOGOUT) + remove_all_indicators() SSnano.nanomanager.user_logout(src) // this is used to clean up (remove) this user's Nano UIs if(interactee) unset_interaction() diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 89ae8a4202cf..a8eead2fe629 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -426,17 +426,26 @@ . = ..() if(.) return + if(href_list["mach_close"]) var/t1 = href_list["mach_close"] unset_interaction() close_browser(src, t1) + return TRUE if(href_list["flavor_more"]) show_browser(usr, "[replacetext(flavor_text, "\n", "
")]
", name, name, "size=500x200") onclose(usr, "[name]") + return TRUE + if(href_list["flavor_change"]) update_flavor_text() - return + return TRUE + + if(href_list["preference"]) + if(client) + client.prefs.process_link(src, href_list) + return TRUE /mob/proc/swap_hand() hand = !hand @@ -984,15 +993,6 @@ note dizziness decrements automatically in the mob's Life() proc. GLOB.dead_mob_list += src return ..() -/mob/Topic(href, href_list) - . = ..() - if(.) - return - if(href_list["preference"]) - if(client) - client.prefs.process_link(src, href_list) - return TRUE - /mob/proc/reset_perspective(atom/A) if(!client) return diff --git a/code/modules/organs/limbs.dm b/code/modules/organs/limbs.dm index bb5da81a799b..ed1ff2db43dd 100644 --- a/code/modules/organs/limbs.dm +++ b/code/modules/organs/limbs.dm @@ -105,16 +105,6 @@ if(owner) forceMove(owner) - - -/* -/obj/limb/proc/get_icon(icon/race_icon, icon/deform_icon) - return icon('icons/mob/human.dmi',"blank") -*/ - -/obj/limb/process() - return 0 - /obj/limb/Destroy() if(parent) parent.children -= src @@ -601,7 +591,6 @@ This function completely restores a damaged organ to perfect condition. return FALSE /obj/limb/process() - // Process wounds, doing healing etc. Only do this every few ticks to save processing power if(owner.life_tick % wound_update_accuracy == 0) update_wounds() diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index 8ff67fa4b91c..57a130c250ba 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -161,12 +161,17 @@ GLOBAL_LIST_INIT(apc_wire_descriptions, list( set_broken() /obj/structure/machinery/power/apc/Destroy() + area.power_light = 0 + area.power_equip = 0 + area.power_environ = 0 + area.power_change() + if(terminal) terminal.master = null terminal = null QDEL_NULL(cell) area = null - . = ..() + return ..() // TGUI SHIT \\ @@ -330,6 +335,7 @@ GLOBAL_LIST_INIT(apc_wire_descriptions, list( // the very fact that i have to override this screams to me that apcs shouldnt be under machinery - spookydonut /obj/structure/machinery/power/apc/power_change() + update_icon() return /obj/structure/machinery/power/apc/proc/make_terminal() @@ -428,7 +434,7 @@ GLOBAL_LIST_INIT(apc_wire_descriptions, list( //2 if we need to update the overlays if(!update) return - + set_light(0) if(update & 1) //Updating the icon state @@ -478,7 +484,7 @@ GLOBAL_LIST_INIT(apc_wire_descriptions, list( overlays += mutable_appearance(_lighting.icon, _lighting.icon_state) overlays += emissive_appearance(_environ.icon, _environ.icon_state) overlays += mutable_appearance(_environ.icon, _environ.icon_state) - + switch(charging) if(APC_NOT_CHARGING) set_light_color(LIGHT_COLOR_RED) @@ -1335,13 +1341,6 @@ GLOBAL_LIST_INIT(apc_wire_descriptions, list( L.broken() sleep(1) -/obj/structure/machinery/power/apc/Destroy() - area.power_light = 0 - area.power_equip = 0 - area.power_environ = 0 - area.power_change() - . = ..() - /obj/structure/machinery/power/apc/wires_cut icon_state = "apcewires_mapicon" diff --git a/code/modules/power/power.dm b/code/modules/power/power.dm index 9aefa21d0f7a..ca45ab74f9db 100644 --- a/code/modules/power/power.dm +++ b/code/modules/power/power.dm @@ -83,13 +83,14 @@ if(stat & NOPOWER) addToListNoDupe(GLOB.processing_machines, src) // power interrupted us, start processing again stat &= ~NOPOWER - src.update_use_power(USE_POWER_IDLE) - + update_use_power(USE_POWER_IDLE) else if(machine_processing) GLOB.processing_machines -= src // no power, can't process. stat |= NOPOWER - src.update_use_power(USE_POWER_NONE) + update_use_power(USE_POWER_NONE) + + update_icon() // the powernet datum // each contiguous network of cables & nodes diff --git a/code/modules/projectiles/gun_attachables.dm b/code/modules/projectiles/gun_attachables.dm index c7f68f2492a7..12d9f787aa32 100644 --- a/code/modules/projectiles/gun_attachables.dm +++ b/code/modules/projectiles/gun_attachables.dm @@ -2837,7 +2837,7 @@ Defined in conflicts.dm of the #defines folder. /obj/item/attachable/attached_gun/grenade/Initialize() . = ..() - grenade_pass_flags = PASS_HIGH_OVER|PASS_MOB_THRU + grenade_pass_flags = PASS_HIGH_OVER|PASS_MOB_THRU|PASS_OVER /obj/item/attachable/attached_gun/grenade/New() ..() diff --git a/code/modules/projectiles/guns/lever_action.dm b/code/modules/projectiles/guns/lever_action.dm index 501483f39923..86e7fb7ebb3b 100644 --- a/code/modules/projectiles/guns/lever_action.dm +++ b/code/modules/projectiles/guns/lever_action.dm @@ -158,18 +158,6 @@ their unique feature is that a direct hit will buff your damage and firerate current_mag.chamber_contents[i] = i > number_to_replace ? "empty" : current_mag.default_ammo current_mag.chamber_position = current_mag.current_rounds //The position is always in the beginning [1]. It can move from there. -/obj/item/weapon/gun/lever_action/proc/add_to_internal_mag(mob/user,selection) //bullets are added forward. - if(!current_mag) - return - current_mag.chamber_position++ //We move the position up when loading ammo. New rounds are always fired next, in order loaded. - current_mag.chamber_contents[current_mag.chamber_position] = selection //Just moves up one, unless the mag is full. - if(current_mag.current_rounds == 1 && !in_chamber) //The previous proc in the reload() cycle adds ammo, so the best workaround here, - update_icon() //This is not needed for now. Maybe we'll have loaded sprites at some point, but I doubt it. Also doesn't play well with double barrel. - ready_in_chamber() - cock_gun(user) - if(user) playsound(user, reload_sound, 25, TRUE) - return TRUE - /obj/item/weapon/gun/lever_action/proc/empty_chamber(mob/user) if(!current_mag) return @@ -227,27 +215,13 @@ their unique feature is that a direct hit will buff your damage and firerate current_mag.chamber_position-- return in_chamber -/obj/item/weapon/gun/lever_action/ready_in_chamber() - return ready_lever_action_internal_mag() - -/obj/item/weapon/gun/lever_action/reload_into_chamber(mob/user) - if(!active_attachable) - in_chamber = null - - //Time to move the internal_mag position. - ready_in_chamber() //We're going to try and reload. If we don't get anything, icon change. - if(!current_mag.current_rounds && !in_chamber) //No rounds, nothing chambered. - update_icon() - - return TRUE - /obj/item/weapon/gun/lever_action/unique_action(mob/user) work_lever(user) /obj/item/weapon/gun/lever_action/ready_in_chamber() return -/obj/item/weapon/gun/lever_action/add_to_internal_mag(mob/user, selection) //Load it on the go, nothing chambered. +/obj/item/weapon/gun/lever_action/proc/add_to_internal_mag(mob/user, selection) //Load it on the go, nothing chambered. if(!current_mag) return current_mag.chamber_position++ diff --git a/code/modules/projectiles/guns/revolvers.dm b/code/modules/projectiles/guns/revolvers.dm index 0cfd06c164be..2d85d7a43bfb 100644 --- a/code/modules/projectiles/guns/revolvers.dm +++ b/code/modules/projectiles/guns/revolvers.dm @@ -419,7 +419,7 @@ /obj/item/weapon/gun/revolver/m44/custom/pkd_special/l_series/set_gun_attachment_offsets() attachable_offset = list("muzzle_x" = 29, "muzzle_y" = 22,"rail_x" = 11, "rail_y" = 25, "under_x" = 20, "under_y" = 18, "stock_x" = 20, "stock_y" = 18) -/obj/item/weapon/gun/revolver/m44/custom/pkd_special/set_gun_config_values() +/obj/item/weapon/gun/revolver/m44/custom/pkd_special/l_series/set_gun_config_values() ..() accuracy_mult = BASE_ACCURACY_MULT + HIT_ACCURACY_MULT_TIER_4 damage_mult = BASE_BULLET_DAMAGE_MULT + BULLET_DAMAGE_MULT_TIER_2 diff --git a/code/modules/reagents/chemistry_machinery/chem_master.dm b/code/modules/reagents/chemistry_machinery/chem_master.dm index 103826461b2d..e6c989a3c8f8 100644 --- a/code/modules/reagents/chemistry_machinery/chem_master.dm +++ b/code/modules/reagents/chemistry_machinery/chem_master.dm @@ -52,11 +52,6 @@ deconstruct(FALSE) return - -/obj/structure/machinery/chem_master/power_change() - ..() - update_icon() - /obj/structure/machinery/chem_master/update_icon() if(stat & BROKEN) icon_state = (beaker?"mixer1_b":"mixer0_b") diff --git a/code/modules/recycling/recycler.dm b/code/modules/recycling/recycler.dm index b61854d2e788..f10c2f343f1a 100644 --- a/code/modules/recycling/recycler.dm +++ b/code/modules/recycling/recycler.dm @@ -23,10 +23,6 @@ . = ..() update_icon() -/obj/structure/machinery/recycler/power_change() - ..() - update_icon() - /obj/structure/machinery/recycler/update_icon() . = ..() icon_state = "separator-AO[(inoperable()) ? "0":"1"]" diff --git a/code/modules/shuttle/shuttles/dropship.dm b/code/modules/shuttle/shuttles/dropship.dm index 5da2f88eaa8f..6a4053ce5464 100644 --- a/code/modules/shuttle/shuttles/dropship.dm +++ b/code/modules/shuttle/shuttles/dropship.dm @@ -44,18 +44,21 @@ door_control.add_door(air, "port") if("aft_door") door_control.add_door(air, "aft") + var/obj/structure/machinery/door/airlock/multi_tile/almayer/dropshiprear/hatch = air if(istype(hatch)) hatch.linked_dropship = src RegisterSignal(src, COMSIG_DROPSHIP_ADD_EQUIPMENT, PROC_REF(add_equipment)) RegisterSignal(src, COMSIG_DROPSHIP_REMOVE_EQUIPMENT, PROC_REF(remove_equipment)) + RegisterSignal(src, COMSIG_ATOM_DIR_CHANGE, PROC_REF(on_dir_change)) /obj/docking_port/mobile/marine_dropship/Destroy(force) . = ..() qdel(door_control) UnregisterSignal(src, COMSIG_DROPSHIP_ADD_EQUIPMENT) UnregisterSignal(src, COMSIG_DROPSHIP_REMOVE_EQUIPMENT) + UnregisterSignal(src, COMSIG_ATOM_DIR_CHANGE) /obj/docking_port/mobile/marine_dropship/proc/send_for_flyby() in_flyby = TRUE @@ -73,25 +76,6 @@ /obj/docking_port/mobile/marine_dropship/proc/get_door_data() return door_control.get_data() -/obj/docking_port/mobile/marine_dropship/Initialize(mapload) - . = ..() - door_control = new() - for(var/place in shuttle_areas) - for(var/obj/structure/machinery/door/air in place) - switch(air.id) - if("starboard_door") - door_control.add_door(air, "starboard") - if("port_door") - door_control.add_door(air, "port") - if("aft_door") - door_control.add_door(air, "aft") - RegisterSignal(src, COMSIG_ATOM_DIR_CHANGE, PROC_REF(on_dir_change)) - -/obj/docking_port/mobile/marine_dropship/Destroy(force) - . = ..() - qdel(door_control) - UnregisterSignal(src, COMSIG_ATOM_DIR_CHANGE) - /obj/docking_port/mobile/marine_dropship/proc/control_doors(action, direction, force, asynchronous = TRUE) // its been locked down by the queen if(door_override) diff --git a/code/modules/surgery/robotic_organs_internal.dm b/code/modules/surgery/robotic_organs_internal.dm index 7081a7cb3ccb..f268b959d7ec 100644 --- a/code/modules/surgery/robotic_organs_internal.dm +++ b/code/modules/surgery/robotic_organs_internal.dm @@ -35,7 +35,7 @@ and organ transplant code which may come in handy in future but haven't been edi time = 3 SECONDS repeat_step = TRUE -/datum/surgery_step/repair_organs/repeat_step_criteria(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, tool_type, datum/surgery/surgery) +/datum/surgery_step/repair_robotic_organs/repeat_step_criteria(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, tool_type, datum/surgery/surgery) for(var/datum/internal_organ/IO as anything in surgery.affected_limb.internal_organs) if(IO.damage > 0 && IO.robotic == ORGAN_ROBOT) return TRUE diff --git a/code/modules/tgui/tgui-say/typing.dm b/code/modules/tgui/tgui-say/typing.dm index e2d8e5fa2a07..fdc38e1fb8cd 100644 --- a/code/modules/tgui/tgui-say/typing.dm +++ b/code/modules/tgui/tgui-say/typing.dm @@ -18,10 +18,6 @@ /mob/proc/remove_all_indicators() return -/mob/Logout() - remove_all_indicators() - return ..() - /// Whether or not to show a typing indicator when speaking. Defaults to on. /client/verb/typing_indicator() set name = "Show/Hide Typing Indicator" diff --git a/code/modules/vehicles/hardpoints/secondary/grenade_launcher.dm b/code/modules/vehicles/hardpoints/secondary/grenade_launcher.dm index 1d3243103e90..ee06e7405e07 100644 --- a/code/modules/vehicles/hardpoints/secondary/grenade_launcher.dm +++ b/code/modules/vehicles/hardpoints/secondary/grenade_launcher.dm @@ -31,10 +31,6 @@ BULLET_TRAIT_ENTRY(/datum/element/bullet_trait_iff) )) -/obj/item/attachable/attached_gun/grenade/Initialize() - . = ..() - grenade_pass_flags = PASS_MOB_THRU_HUMAN|PASS_MOB_IS_OTHER|PASS_OVER - /obj/item/hardpoint/secondary/grenade_launcher/try_fire(atom/target, mob/living/user, params) if(get_turf(target) in owner.locs) to_chat(user, SPAN_WARNING("The target is too close.")) diff --git a/code/modules/vehicles/multitile/multitile_bump.dm b/code/modules/vehicles/multitile/multitile_bump.dm index 2eb12b0aab82..f4522004a993 100644 --- a/code/modules/vehicles/multitile/multitile_bump.dm +++ b/code/modules/vehicles/multitile/multitile_bump.dm @@ -258,12 +258,6 @@ /obj/structure/prop/dam/torii/handle_vehicle_bump(obj/vehicle/multitile/V) return FALSE -/obj/structure/prop/dam/large_boulder/handle_vehicle_bump(obj/vehicle/multitile/V) - return FALSE - -/obj/structure/prop/dam/wide_boulder/handle_vehicle_bump(obj/vehicle/multitile/V) - return FALSE - /obj/structure/flora/tree/handle_vehicle_bump(obj/vehicle/multitile/V) if(V.vehicle_flags & VEHICLE_CLASS_WEAK) return FALSE diff --git a/code/modules/vehicles/van/box_van.dm b/code/modules/vehicles/van/box_van.dm index 80c23bb6ef67..17f68563ddef 100644 --- a/code/modules/vehicles/van/box_van.dm +++ b/code/modules/vehicles/van/box_van.dm @@ -121,6 +121,9 @@ ** PRESETS */ /obj/vehicle/multitile/box_van/pre_movement() + if(locate(/obj/effect/alien/weeds) in loc) + move_momentum *= momentum_loss_on_weeds_factor + . = ..() for(var/icon in mobs_under) @@ -180,14 +183,6 @@ return ..() - -/obj/vehicle/multitile/box_van/pre_movement() - if(locate(/obj/effect/alien/weeds) in loc) - move_momentum *= momentum_loss_on_weeds_factor - - . = ..() - - /obj/vehicle/multitile/box_van/attackby(obj/item/O, mob/user) if(user.z != z) return ..() diff --git a/code/modules/vehicles/van/van.dm b/code/modules/vehicles/van/van.dm index a2e7d68bf9de..8ff31b6f11ba 100644 --- a/code/modules/vehicles/van/van.dm +++ b/code/modules/vehicles/van/van.dm @@ -112,6 +112,9 @@ ** PRESETS */ /obj/vehicle/multitile/van/pre_movement() + if(locate(/obj/effect/alien/weeds) in loc) + move_momentum *= momentum_loss_on_weeds_factor + . = ..() for(var/I in mobs_under) @@ -171,14 +174,6 @@ return ..() - -/obj/vehicle/multitile/van/pre_movement() - if(locate(/obj/effect/alien/weeds) in loc) - move_momentum *= momentum_loss_on_weeds_factor - - . = ..() - - /obj/vehicle/multitile/van/attackby(obj/item/O, mob/user) if(user.z != z) return ..() diff --git a/code/modules/vehicles/vehicle.dm b/code/modules/vehicles/vehicle.dm index b7f29da67fe7..f470b15af585 100644 --- a/code/modules/vehicles/vehicle.dm +++ b/code/modules/vehicles/vehicle.dm @@ -248,7 +248,6 @@ /obj/vehicle/proc/RunOver(mob/living/carbon/human/H) return //write specifics for different vehicles - /obj/vehicle/afterbuckle(mob/M) . = ..() if(. && buckled_mob == M) @@ -259,8 +258,6 @@ M.pixel_y = initial(buckled_mob.pixel_y) M.old_y = initial(buckled_mob.pixel_y) -/obj/vehicle/afterbuckle(mob/M) - . = ..() if(seats[VEHICLE_DRIVER] == null) seats[VEHICLE_DRIVER] = M